Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


2d in OGL

This topic is 5319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

how do i render a texture to the screen? like as 2D? after i init opengl i have got: [cpp] GLDevice::GetInstance().BeginRender(); TGA loadScreen; loadScreen.LoadImage( "data/splash.tga", false ); loadScreen.SetTexture(); glOrtho(0, 800, 600, 0, 0, 10); float size = 200; glBegin(GL_QUADS); loadScreen.SetTexture(); glTexCoord2f(0.0f, 0.0f); //glColor4f(1,0,0,0); glVertex3f( 0, 0, 5 ); glTexCoord2f(1.0f, 0.0f); glVertex3f( 800, 0, 5 ); glTexCoord2f(1.0f, 1.0f); glVertex3f( 800, 600, 5 ); glTexCoord2f(0.0f, 1.0f); glVertex3f( 0, 600, 5 ); glEnd(); GLDevice::GetInstance().EndRender(); [/cpp] all i get is a white quad :-/ [edited by - supagu on February 28, 2004 3:47:20 AM]

Share this post

Link to post
Share on other sites
I guess that your texture size is not 2^n x 2^n .. so it won''t work.

you need square 2^n sized textures for OpenGL (d3d too i think) so you could make an utility to split that 800x600 texture in 128x128 bits and load them separately and render them as such (load with GL_CLAMP_TO_EDGE as params)

or you could use glDrawPixels which is really slow but could work for a splash screen.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!