Posted by: X-0ut
Date posted: Jan 24 2004 User Rating: 5 out of 5.0 | Number of views: 7386 Number of comments: 7 | Description: Simple rendering. |
Quick & simple, heres how to draw visible surfaces (bsp only) - unlit.
| | model_t* world = gEngfuncs.GetEntityByIndex(0)->model; msurface_t** s=world->marksurfaces; glpoly_t* p; texture_t* tex; glColor4f(1,1,1,1); for(int i=0;i<world->nummarksurfaces;i++) { if(s[i]->visframe!=-1) { tex=s[i]->texinfo->texture; glBindTexture(GL_TEXTURE_2D,tex->gl_texturenum); p=s[i]->polys; glBegin (GL_POLYGON); float* v = p->verts[0]; for (int t=0 ; t<p->numverts ; t++, v+= VERTEXSIZE) { glTexCoord2f (v[3], v[4]); glVertex3fv (v); } glEnd (); s[i]->visframe=-1; } }
| |
|
User Comments
Showing comments 1-7
Ehhh.... Which includes does this need...
the standard TriAPI includes, <gl/gl.h>, <windows.h>
and what else? |
|
I should have noted you need the modified com_model header containing the hardware definitions. If you dont have it I can put it up on my image dump? |
|
nevermind, problem solvedEdited by rein on Feb 18 2004, 23:19:20
|
|
If you don't know where to put this, you shouldn't be trying... |
|
Wow cool! :D I needed this... Hmmm... I don't have gl_texturenum def. |
|
hmm it seems to moast of time bind the worng texture in steam is it just my gfx card or dose anyone esle get this problem |
|
You must register to post a comment. If you have already registered, you must login.
|