SDL and OpenGL game, what still to use in SDL.
Moderator: Coders of Rage
- jakobnator
- Chaos Rift Newbie
- Posts: 20
- Joined: Thu Mar 31, 2011 8:14 pm
- Current Project: Black Jack
- Favorite Gaming Platforms: N64,DC,PC,360
- Programming Language of Choice: C++0x
- Location: (n): A particle place in physical space.
SDL and OpenGL game, what still to use in SDL.
Still programming my "games" in SDL, I want to move onto integrating OpenGL since its apparently so awesome. From my understanding the only thing OpenGL can do is render and can't handle input, correct me if I am wrong. So I am assuming that when you integrate OpenGL with SDL all that you need from SDL is input? I would just like some clarity on this and any other information on using OpenGL with SDL is also greatly appreciated.
Current Games:
Black Jack [WIP]
Tic Tac Toe [SDL]
Tic Tac Toe
-
- Respected Programmer
- Posts: 387
- Joined: Fri Dec 19, 2008 3:33 pm
- Location: Dallas
- Contact:
Re: SDL and OpenGL game, what still to use in SDL.
That would be correct. OpenGL handles graphics only.
Use SDL or whatever else to deal with your input and anything else you need.
Use SDL or whatever else to deal with your input and anything else you need.
- YourNerdyJoe
- Chaos Rift Cool Newbie
- Posts: 79
- Joined: Sun Oct 02, 2011 3:28 pm
- Current Project: Top secret (not really) Top-Down Shooter for GBA
- Favorite Gaming Platforms: GBA, Gamecube, PC, 3DS
- Programming Language of Choice: C/C++
- Contact:
Re: SDL and OpenGL game, what still to use in SDL.
I found this for connverting the SDL_Surface into OpenGL textures:
http://content.gpwiki.org/index.php/SDL ... ith_OpenGL
Hope it helps
http://content.gpwiki.org/index.php/SDL ... ith_OpenGL
Hope it helps
- superLED
- Chaos Rift Junior
- Posts: 303
- Joined: Sun Nov 21, 2010 10:56 am
- Current Project: Engine
- Favorite Gaming Platforms: N64
- Programming Language of Choice: C++, PHP
- Location: Norway
Re: SDL and OpenGL game, what still to use in SDL.
I would recommend something pre-built, because this is only for loading .bmp images. And you would need to write a lot of those 'converters' to accept the other image formats.YourNerdyJoe wrote:I found this for connverting the SDL_Surface into OpenGL textures:
http://content.gpwiki.org/index.php/SDL ... ith_OpenGL
Hope it helps
DevIL or SOIL are some neat libraries that you can use to easily load up any image format you so desire. At least do this in the beginning, so it's not that hard of a switch from SDL to OpenGL.
- YourNerdyJoe
- Chaos Rift Cool Newbie
- Posts: 79
- Joined: Sun Oct 02, 2011 3:28 pm
- Current Project: Top secret (not really) Top-Down Shooter for GBA
- Favorite Gaming Platforms: GBA, Gamecube, PC, 3DS
- Programming Language of Choice: C/C++
- Contact:
Re: SDL and OpenGL game, what still to use in SDL.
If you replace SDL_LoadBMP with IMG_Load and it works for everything supported by SDL_image.superLED wrote:I would recommend something pre-built, because this is only for loading .bmp images. And you would need to write a lot of those 'converters' to accept the other image formats.YourNerdyJoe wrote:I found this for connverting the SDL_Surface into OpenGL textures:
http://content.gpwiki.org/index.php/SDL ... ith_OpenGL
Hope it helps
DevIL or SOIL are some neat libraries that you can use to easily load up any image format you so desire. At least do this in the beginning, so it's not that hard of a switch from SDL to OpenGL.
It works nice when it's put in function like
Code: Select all
GLuint LoadTexture(const char* fn)
- superLED
- Chaos Rift Junior
- Posts: 303
- Joined: Sun Nov 21, 2010 10:56 am
- Current Project: Engine
- Favorite Gaming Platforms: N64
- Programming Language of Choice: C++, PHP
- Location: Norway
Re: SDL and OpenGL game, what still to use in SDL.
Yes, but different formats need to be read differently. You can't read and load a .png file the same way you would do with a .jpg file.YourNerdyJoe wrote:If you replace SDL_LoadBMP with IMG_Load and it works for everything supported by SDL_image.superLED wrote:I would recommend something pre-built, because this is only for loading .bmp images. And you would need to write a lot of those 'converters' to accept the other image formats.YourNerdyJoe wrote:I found this for connverting the SDL_Surface into OpenGL textures:
http://content.gpwiki.org/index.php/SDL ... ith_OpenGL
Hope it helps
DevIL or SOIL are some neat libraries that you can use to easily load up any image format you so desire. At least do this in the beginning, so it's not that hard of a switch from SDL to OpenGL.
It works nice when it's put in function likewhick I think is much simpler than using another library.Code: Select all
GLuint LoadTexture(const char* fn)
If you are working with different people, then you must tell them to only use one single format. Or if you get some images from the web, you'd have to convert them into the target format.
SDL_image supports a lot of formats, but the way the function you linked to works, is to read in the pixels from the file the way .png/.bmp is set up.
-
- Chaos Rift Newbie
- Posts: 9
- Joined: Wed May 12, 2010 8:32 am
- Current Project: TwelveSky2 Hacks
- Favorite Gaming Platforms: PC,PS3
- Programming Language of Choice: c#
- Contact:
Re: SDL and OpenGL game, what still to use in SDL.
wow. is gyrovorbis still working on this game? haven't been on this forum for prob a few years : |.
Anyways it really depends on what platform you want to develop for. If you are interested in cross platform capabilities, then you use sdl to handle everything except graphics which opengl handles. But if you are developing for windows and would like your application to be a bit more efficient(also depends on how good you are as a programmer) then use pure windows.h to do sdl's job. Now some may say this is reinventing the wheel and as such a waste of time, but in my opinion is the better option because you can code classes to handle input,window e.t.c without the extra stuff found in sdl. Anyhow it all depends on what your aim is.
Anyways it really depends on what platform you want to develop for. If you are interested in cross platform capabilities, then you use sdl to handle everything except graphics which opengl handles. But if you are developing for windows and would like your application to be a bit more efficient(also depends on how good you are as a programmer) then use pure windows.h to do sdl's job. Now some may say this is reinventing the wheel and as such a waste of time, but in my opinion is the better option because you can code classes to handle input,window e.t.c without the extra stuff found in sdl. Anyhow it all depends on what your aim is.
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: SDL and OpenGL game, what still to use in SDL.
+1saluege wrote:wow. is gyrovorbis still working on this game? haven't been on this forum for prob a few years : |.
Anyways it really depends on what platform you want to develop for. If you are interested in cross platform capabilities, then you use sdl to handle everything except graphics which opengl handles. But if you are developing for windows and would like your application to be a bit more efficient(also depends on how good you are as a programmer) then use pure windows.h to do sdl's job. Now some may say this is reinventing the wheel and as such a waste of time, but in my opinion is the better option because you can code classes to handle input,window e.t.c without the extra stuff found in sdl. Anyhow it all depends on what your aim is.
Additionally Qt, has very nice glut compatible image loading classes and functions that you can use to apply textures: http://www.digitalfanatics.org/projects ... ter14.html (look around the bottom of chapter 6).
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: SDL and OpenGL game, what still to use in SDL.
Get your ass with the program. Check out our new shit on Youtube.saluege wrote:wow. is gyrovorbis still working on this game? haven't been on this forum for prob a few years : |.
Anyways it really depends on what platform you want to develop for. If you are interested in cross platform capabilities, then you use sdl to handle everything except graphics which opengl handles. But if you are developing for windows and would like your application to be a bit more efficient(also depends on how good you are as a programmer) then use pure windows.h to do sdl's job. Now some may say this is reinventing the wheel and as such a waste of time, but in my opinion is the better option because you can code classes to handle input,window e.t.c without the extra stuff found in sdl. Anyhow it all depends on what your aim is.
I really wouldn't recommend all of QT's overhead for a video game. It is a fantastic framework for PC tools, but it isn't meant to be used for game development like that.THe Floating Brain wrote:+1saluege wrote:wow. is gyrovorbis still working on this game? haven't been on this forum for prob a few years : |.
Anyways it really depends on what platform you want to develop for. If you are interested in cross platform capabilities, then you use sdl to handle everything except graphics which opengl handles. But if you are developing for windows and would like your application to be a bit more efficient(also depends on how good you are as a programmer) then use pure windows.h to do sdl's job. Now some may say this is reinventing the wheel and as such a waste of time, but in my opinion is the better option because you can code classes to handle input,window e.t.c without the extra stuff found in sdl. Anyhow it all depends on what your aim is.
Additionally Qt, has very nice glut compatible image loading classes and functions that you can use to apply textures: http://www.digitalfanatics.org/projects ... ter14.html (look around the bottom of chapter 6).