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.


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


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   -  Reputation: 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.


Sponsor:

#2 Lazy Foo   Members   -  Reputation: 1105

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.



PARTNERS