Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411613 Posts in 69390 Topics- by 58447 Members - Latest Member: sinsofsven

May 09, 2024, 06:00:55 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Making the move from SDL to SDL + OpenGL
Pages: [1]
Print
Author Topic: Making the move from SDL to SDL + OpenGL  (Read 1285 times)
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« on: November 22, 2009, 11:32:28 AM »

About a year ago or so I decided to migrate from XNA to SDL because I then felt that XNA wouldn't get me the player base I was looking for. When porting the core game engine I opted out of using pixel shaders and now I feel like I want to get back to using them and to pull that off I'm going to switch out my pure SDL solution for SDL + OpenGL.

Now, does that mean I have to transfer all sprite sheets and font work to be rendered by hardware or is it possible to update three 512x256 textures every frame in 25 frames per second and only use the OpenGL stuff for shaders?
Who, Me?
Logged
Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #1 on: November 22, 2009, 11:37:04 AM »

Doesn't SDL run on top of OpenGL?  I know you can access the raw texture data from an SDL_Image via a pointer.  Honestly, I use SOIL so I'm not too sure about that.

But yeah, I use SOIL to load OpenGL texture data.  At that point you can use it as you normally would.  I guess I don't understand the question.  Facepalm
Logged

I'd write a devlog about my current game, but I'm too busy making it.
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #2 on: November 22, 2009, 11:43:28 AM »

For sprites in OpenGL, you don't update textures every frame, you just shift the texture mapping coordinates within the sprite sheet texture.
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #3 on: November 22, 2009, 11:52:52 AM »

From your answers I deduct that I'm better off doing things the proper way. I'll register all the spritesheets as textures and then do some OpenGL hodo to get the animations to run correctly.

I guess that means I have to read up on OpenGL because right now I have a very limited understanding of how it works.

Thanx for the quick answers.
Logged
powly
Level 4
****



View Profile WWW
« Reply #4 on: November 22, 2009, 12:28:26 PM »

It actually is quite possible to just take your screen pointer and turn it into an OpenGL texture. I don't know how fast it will be but it shouldn't be too hard and you'll get your fragment shader up and running.

But of course if you'll go the pure OpenGL way you'll gain a lot of speed and it might actually be easier in the end. Depends on what your shader does; what data it needs.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic