![]() ![]() Final note is that as of 2019, Valve updated the steam GoldSrc engine to better handle non-power2 texture display. If you are making a stand-alone mod then ignore this warning. Keep in mind there is no texture compression so your texture filesizes can build up quickly because of this I also stress to use 512X512 very sparingly if you are making maps for multiplayer server download. GoldSrc textures must be BMP format with an 8-bit depth (256 colors index/palette) and dimensions must be in multiples of 16 though it is preferable to have them in powers of 2 because they are generally easier to work with. Im not sure what other way to pass it.1)Welcome to the GoldSrc Texture tutorial. GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) GlTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) GlTe圎nvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) GlTexImage2D(GL_TEXTURE_2D, 0, 3, outwidth, outheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, out) out = tex = (BYTE*)malloc(outwidth * outheight * 4) Ĭol2 = (int)((i + 0.75) * (text->width / (float)outwidth)) įor(i=0 iheight / (float)outheight)) * text->width Static int gtexnum = 1 for(outwidth=1 outwidthwidth outwidth 256)įor(outheight=1 outheightheight outheight 256) ![]() Void UpLoadTexture(Texture* text, BYTE* data, BYTE* pal) Im not sure whats wrong though I passed it to another pointer and still nothing. What I think the error is is with the pointer. I cannt beleve I missed thoses to many late nights I guess hehehee. I zeroed out tmp and took out the semicolon. Well apprently its not being passed to OGL all im seeing is a black cube. GlBindTexture(GL_TEXTURE_2D, mdl.extracttext) In the display funtion and NuclearMDL I added some code to get the texture number thats being used. GlTexCoord2f(1.0f, 1.0f) glVertex3f(-1.0f, 1.0f, 1.0f) // Top Right Of The Texture and Quad GlTexCoord2f(0.0f, 0.0f) glVertex3f(-1.0f, -1.0f, -1.0f) // Bottom Left Of The Texture and Quad GlTexCoord2f(0.0f, 1.0f) glVertex3f( 1.0f, 1.0f, 1.0f) // Top Left Of The Texture and Quad GlTexCoord2f(1.0f, 0.0f) glVertex3f( 1.0f, -1.0f, -1.0f) // Bottom Right Of The Texture and Quad GlTexCoord2f(1.0f, 0.0f) glVertex3f(-1.0f, -1.0f, 1.0f) // Bottom Right Of The Texture and Quad GlTexCoord2f(0.0f, 0.0f) glVertex3f( 1.0f, -1.0f, 1.0f) // Bottom Left Of The Texture and Quad GlTexCoord2f(0.0f, 1.0f) glVertex3f( 1.0f, -1.0f, -1.0f) // Top Left Of The Texture and Quad GlTexCoord2f(1.0f, 1.0f) glVertex3f( 1.0f, 1.0f, -1.0f) // Top Right Of The Texture and Quad ![]() GlTexCoord2f(1.0f, 0.0f) glVertex3f( 1.0f, 1.0f, 1.0f) // Bottom Right Of The Texture and Quad GlTexCoord2f(0.0f, 0.0f) glVertex3f(-1.0f, 1.0f, 1.0f) // Bottom Left Of The Texture and Quad GlTexCoord2f(0.0f, 1.0f) glVertex3f(-1.0f, 1.0f, -1.0f) // Top Left Of The Texture and Quad GlTexCoord2f(0.0f, 0.0f) glVertex3f( 1.0f, -1.0f, -1.0f) // Bottom Left Of The Texture and Quad GlTexCoord2f(0.0f, 1.0f) glVertex3f( 1.0f, 1.0f, -1.0f) // Top Left Of The Texture and Quad GlTexCoord2f(1.0f, 1.0f) glVertex3f(-1.0f, 1.0f, -1.0f) // Top Right Of The Texture and Quad GlTexCoord2f(1.0f, 0.0f) glVertex3f(-1.0f, -1.0f, -1.0f) // Bottom Right Of The Texture and Quad GlTexCoord2f(0.0f, 1.0f) glVertex3f(-1.0f, 1.0f, 1.0f) // Top Left Of The Texture and Quad GlTexCoord2f(1.0f, 1.0f) glVertex3f( 1.0f, 1.0f, 1.0f) // Top Right Of The Texture and Quad GlTexCoord2f(1.0f, 0.0f) glVertex3f( 1.0f, -1.0f, 1.0f) // Bottom Right Of The Texture and Quad GlTexCoord2f(0.0f, 0.0f) glVertex3f(-1.0f, -1.0f, 1.0f) // Bottom Left Of The Texture and Quad ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |