Game Development Community

GFX for beginners

by Erik Madison · in Torque Game Engine Advanced · 12/25/2004 (2:23 am) · 4 replies

I'm trying to convert over a few files with lots of GL_ code in them. Anyone give me a pointer to how to use the new gfx calls instead? Are there any docs or files I should read? The docs I found simply mention that gfx is similar in use to D3D. There are many gfx files, too many to know where to start. The only reference I can find is the converted precip code, but that was a pretty simplistic use to begin with, so its not much of a help.

#1
12/25/2004 (11:06 am)
Look at the documentation for GFXDevice, or look at gfxDevice.h

GFX is buffer driven. So for example, code like this:
glBegin(GL_LINES);
glVertex3fv( pointA );
glVertex3fv( pointB );
glEnd();
doesn't have a direct translation into GFX. Using that example, it would depend on what kind of a call that was. Does it get rendered every frame? Do points A and B change? To understand how to properly put it into GFX you need to understand what the rendering code is doing.

If you have specific questions I can answer them, but it is hard to give you advice with a general request like that.
#2
12/25/2004 (1:29 pm)
Well, for the most part, all of my questions on usage are general :(
I did manage to render the audio emitters (new audio from marcelo), using the world editor code as a guideline. I'd also like to re-add the distance outlines, but that gl code is very much more involved, and thus has no gfx to follow along with.
Even though I'm not adept at graphics, I was able to accompish everything in gl, using just a few tutorials/samples from the net. With the new gfx code, I'm completely lost. I guess I'll just have to wait until you guys convert a few more things over, so I have more examples to follow with. There is a LOT of gl code still unconverted left in the source.
#3
12/29/2004 (10:38 am)
There is a primitive builder class in the gfx directory that has a gl-like interface. Its not efficient for rendering a lot of polys, but if you just need something crude to draw a couple polys, then it will suit your needs.
#4
12/30/2004 (8:43 am)
Yeah, we use primbuilder a lot in things like editors were performance isn't as big a deal.