What's the best compiler for graphics primitives? [Archive] - C Board

PDA

View Full Version : What's the best compiler for graphics primitives?


monguin61
05-28-2002, 05:14 PM
I am used to using BASIC on my graphing calculator and Qbasic. I like the simple interface, these languages output directly to the screen, and the commands are few and simple. I'm basically looking for a compiler (or language, if necessary) that will let me work with a console, with good graphics capabilities. If you are familiar with TI calculator basic or Qbasic, think that, but with maybe 800x600 resolution with at the very least a 256 color palette, and definitely mouse capabilities.

valar_king
05-29-2002, 02:05 PM
do a search for "allegro graphics api" from google, because allegro is the way to go for simplicity and power. you'll look at the documentation, and then say to yourself "whoa, i can do a WHOLE lot more with this than i can do with qbasic!" i know, cause i started out on qb4.5 (NOT a good idea though, c++ or c is the best starters language imho)

achacha
05-31-2002, 01:59 PM
Visual C++ Stadard Edition (around 99$US), then download the DirectX 8.1 SDK from Microsoft (free) and you are ready to write games :) Well it's a start anyhow.

Bubba
05-31-2002, 03:49 PM
I'm not sure what you are asking. You can do 800x600x32 bit color in QBasic or any other valid VESA mode. It's just not going to be fast, even in real-mode C its not. Plus in order to back buffer...well you can't because of QBasic's memory model limits. There are some tricks in assembly but I doubt you want to dive head first into them.

QBasic is a good language to begin on. But you must know when you have reached the limits of your language. It's not going to tell you when you have reached that limit, it is for you to decide. If you have to do some fancy tricks just to get something simple like 800x600x32 bit color, chances are that your language is not helping you and therefore it is time to switch to another language.

If you are used to QBasic then you might try Visual Basic 6. You can program for DirectX 8 with it, although DirectX is primarily designed to be used with C/C++. But you can get some very good graphics even in VB6 with DirectX 8.

If you are not familiar with types and objects in QB, I would brush up on those skills prior to attempting VB6.

For instance:


type point2d
x as integer
y as integer
end type

type point3d
x as double
y as double
z as double
end type

type vertex
vlocal as point3d
vworld as point3d
vview as point3d
pscreen as point2d
end type

dim shared vertexlist[100] as vertex


Nearly the same as this in C:

struct point2d
{
int x;
int y;
};

struct point3d
{
double x;
double y;
double z;
};

struct vertex
{
point3d vlocal;
point3d vworld;
point3d vview;
point2d pscreen;
};

vertex vertexlist[100];

or

vertex *vertexlist=new vertex[100];


You can use interrupts in QB via the CALL INTERRUPT family of functions (SUBs).

To plot pixels in SVGA modes in QB you will need to use POKE to place each value in the correct location in video memory. You will also have to have a bank switching function. You might be able to point QB to the far bank swithing function of the video card using CALLS (formerly CALL ABSOLUTE) but I haven't tried that.
I use the interrupt (C: 0x10 - asm: 10h - QB: &H10) to bank switch. Check the RBIL for more info.

Flikm
06-03-2002, 12:48 AM
i thought this was a c/c++ programming site. youre asking for qbasic info.