Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Need Help : How to make buttons in SDL_opengl?


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
4 replies to this topic

#1 pandaraf   Members   -  Reputation: 108

Like
0Likes
Like

Posted 21 June 2012 - 06:43 PM

How to make buttons in SDL_opengl?

When i'm using SDL and use BlitSurface to make button, it's work! But, currently i'm using SDL_opengl, How can i make buttons in SDL_opengl?
SDL_BlitSurface isn't work in SDL_OpenGL.

Any Help? :)

Sponsor:

#2 bollµ   Members   -  Reputation: 354

Like
1Likes
Like

Posted 22 June 2012 - 07:14 AM

I'm pretty sure you're confusing some stuff up :)

1) SDL's default mode of rendering works by "blitting". Thus, you can use operations such as SDL_BlitSurface to render onto the screen.
2) OpenGL, DirectX, etc are all rendering API's that let you interface with the graphics card. They have their own rendering models. So you'll have to use functions provided by openGL. Using blitSurface, newSurface, and most other SDL related rendering functions *will not work* with openGL. this is why you're not able to see anything being rendered on the screen.
3) as for making buttons in SDL_openGL, you can either a) use a library such as GLUT(http://www.opengl.org/resources/libraries/glut/) or b) roll your own menu system. I'd suggest using GLUT if you're a beginner. (being quite new to this myself, it's helped me save loads of trouble :P)

some useful links: http://nehe.gamedev.net/ (outdated in some areas, but is still pretty solid)
http://www.opengl.org/archives/resources/faq/technical/gettingstarted.htm
http://www.libsdl.org/opengl/index.php

hope this helps!
PS- I'm really sorry if I've messed up the terminology. I'm quite new to programming >.>;

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)


#3 pandaraf   Members   -  Reputation: 108

Like
0Likes
Like

Posted 22 June 2012 - 06:52 PM

3) as for making buttons in SDL_openGL, you can either a) use a library such as GLUT(http://www.opengl.or...libraries/glut/) or b) roll your own menu system. I'd suggest using GLUT if you're a beginner. (being quite new to this myself, it's helped me save loads of trouble )


Hmm...

1. Is GLUT can run in Ubuntu?
2. How about GLUI, what's the difference?
3. If neither of them, is SDL_opengl can make Buttons by itself? or still need another library?

Perharps, i will use one of them.

#4 bollµ   Members   -  Reputation: 354

Like
0Likes
Like

Posted 23 June 2012 - 09:10 AM

I'm not really sure about *nix, but as far as I've heard, yes, it does run. GLUI depends on GLUT.

So the dependency chain would be GLUI -> GLUT -> OpenGL (SDL_OpenGL).

Hope you manage to complete what you want :)

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)


#5 pandaraf   Members   -  Reputation: 108

Like
0Likes
Like

Posted 23 June 2012 - 05:21 PM

I'm not really sure about *nix, but as far as I've heard, yes, it does run. GLUI depends on GLUT.

So the dependency chain would be GLUI -> GLUT -> OpenGL (SDL_OpenGL).

Hope you manage to complete what you want Posted Image


Oh, so that is how they are work :D
Do you have a link that contain how to setting glut and glui in an IDE?

I have search in google, but it really hard to find the correct one :S




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