Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to display sprites in a opengl game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 decoder55   Members   -  Reputation: 115

Like
0Likes
Like

Posted 26 July 2013 - 05:32 AM

Hi everyone, i'm new in game developing. Recently i programmed my first game, a pong game. I used c++ with opengl. The game works very well, but now i want to improve my desing. I don' t know what is de common way to do this, but the general idea is change the quads i've made with opengl (for the ball and the rackets) by 2D sprites i designed.

 

I don't know if this kind of things can be done with opengl. I need specific libraries or toolkits? And one more question, can i make a GUI with sprites as buttons?

 

Thanks a lot! biggrin.png



Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 6060

Like
0Likes
Like

Posted 26 July 2013 - 05:47 AM

Just slap a texture on the quads.

 

You can also use orthographic projection to render in 2D.


I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#3 MarekKnows.com   Members   -  Reputation: 478

Like
0Likes
Like

Posted 15 August 2013 - 11:21 AM

sprites are nothing more than a quad with a textured drawn on top of it.  By using the alpha channel in your texture you can make objects looks like spheres or characters even though the underlining geometry is still two triangles.


---
Free C++, OpenGL, and Game Development Video Tutorials @
www.MarekKnows.com
Play my free games: Ghost Toast, Zing, Jewel Thief





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS