Rendering Quake2 bsp data to screen

Started by
4 comments, last by RedKnite 23 years, 10 months ago
Alright, im trying to load & display a quake2 level. I successfully load all the vertex/face/leaf/ etc data out of the file and know that its correct as ive checked it aginst carmack''s bspinfo utility. But when i go to render the data in opengl i get nothing, just a blank screen. wether it be faces, verticies, or whatever. Any ideas? thanks ~ chris
Advertisement
Probably a bug in your display code...
Nothing much more to say since you didn''t post any details/source code.

Protozone
Sorry for the lack of detail related to the problem.

Basically after createing the window/initializing opengl etc, my routines to load the .bsp data are executed, all the data is loaded into proper structures.

At this point rendering code is called, and that just doesnt work. at this point id jump for joy to even get it to display vertex data. Heres the display code.

btw im using glut for lazyness purposes at the moment.


void RenderMap()
{
GLfloat z;

glClear(GL_COLOR_BUFFER_BIT);
z = -50.0f;

glBegin(GL_POINTS);

for(int i = 0; i < n_vertices; i++, dvertex++)
glVertex3f((GLfloat)dvertex->x, (GLfloat)dvertex->y, (GLfloat)dvertex->z);
glEnd();
glFlush();
}


Im pretty much convinced that it has something to do with my viewing volume, but not positive. any help is appretiated.
I have never used OpenGL for anything nor do I know how to use all the functions and stuff... I would guess that glFlush() only deallocates the currently allocated memory for the vertices, and that''s about all it does... well then I don''t see your drawing routine that displays the vertices on the screen.. I remember seeing a function like DrawPrimitive() or something like that... So what you''re doing now is basically creating vertices, and then removing them without actualy displaying them on the screen by using one of OpenGL''s funcy''s... anyways... Hope this helps, and good luck to you!

..-=ViKtOr=-..
yes im drawing it to the screen, thats what the glVertex3f(x,y,z) is for.
Where are you swapping your buffer to the screen (where's your call to glutSwapBuffers())? Also, try calling flush after you loop for displaying vertices (not inside the loop).

Morgan

Edited by - Morgan on June 28, 2000 10:10:16 PM

This topic is closed to new replies.

Advertisement