How to use VAR

Sage
Posts: 1,231
Joined: 2002.10
Post: #7
The first argument is the size in bytes to map to VAR in AGP-space, or flush (so the card can begin DMA), respectively. Read the spec again: http://oss.sgi.com/projects/ogl-sample/r..._range.txt

In my example:
Code:
#define VAR_size 2048
#define VAR_bufs 2

What you put in Vertex depends entirely on what you want to draw. In my case, 2D colored textured quads:

Code:
typedef struct GLCoord2 {
    GLfloat    x;
    GLfloat    y;
} GLCoord2;

typedef struct GLColor4 {
    GLfloat    r;
    GLfloat    g;
    GLfloat    b;
    GLfloat    a;
} GLColor4;

typedef struct Vertex {
    GLColor4    color;
    GLCoord2    texture;
    GLCoord2    vertex;
} Vertex;

Of course, you need to set the pointer for each element array as usual. Edited my initial post's setup section to make that clear.
Quote this message in a reply
Post Reply 


Messages In This Thread
How to use VAR - Josh - Nov 28, 2003, 10:53 AM
How to use VAR - arekkusu - Nov 28, 2003, 09:07 PM
How to use VAR - Josh - Nov 29, 2003, 01:29 AM
How to use VAR - arekkusu - Nov 29, 2003, 01:32 AM
How to use VAR - Josh - Nov 29, 2003, 01:24 PM
How to use VAR - Josh - Nov 29, 2003, 01:56 PM
How to use VAR - arekkusu - Nov 29, 2003 10:46 PM