Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[ask][SDL_opengl] How to use SDL_BlitSurface to make Button

4: Adsense

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
1 reply to this topic

#1 pandaraf   Members   

108
Like
0Likes
Like

Posted 19 June 2012 - 10:29 PM

Hi, i want to make buttons like Lazyfoo has : http://lazyfoo.net/S...son09/index.php
It use SDL_BlitSurface, i try that and work! But, actually i use SDL_opengl for the project. So, i can't use syntax like : "apply_surface( box.x, box.y, buttonSheet, screen, clip )" again. Posted Image

I use this :
"void muncul(int x, int y, int x2, int y2, int x3, int y3, int x4, int y4, GLuint xyz)" that work for show texture correctly. Of course, its only image that appeared. Not like buttons that has mouse_over, mouse_up, mouse_down and mouse_out(like lazyfoo). Posted Image

I want to make buttons in SDL_opengl Posted Image
So, How to use SDL_BlitSurface to make Button in SDL_opengl?

Edited by pandaraf, 20 June 2012 - 05:43 AM.


#2 Lazy Foo   Members   

1113
Like
0Likes
Like

Posted 02 September 2012 - 01:01 PM

Hi, i want to make buttons like Lazyfoo has : http://lazyfoo.net/S...son09/index.php
It use SDL_BlitSurface, i try that and work! But, actually i use SDL_opengl for the project. So, i can't use syntax like : "apply_surface( box.x, box.y, buttonSheet, screen, clip )" again. Posted Image

I use this :
"void muncul(int x, int y, int x2, int y2, int x3, int y3, int x4, int y4, GLuint xyz)" that work for show texture correctly. Of course, its only image that appeared. Not like buttons that has mouse_over, mouse_up, mouse_down and mouse_out(like lazyfoo). Posted Image

I want to make buttons in SDL_opengl Posted Image
So, How to use SDL_BlitSurface to make Button in SDL_opengl?


You can't. When using OpenGL rendering, you can't use SDL rendering calls.

If you can make a texture appear, all you have to is make a different texture appear depending on the mouse state.

Learn to make games with my SDL 2 Tutorials





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.