SDL and OpenGL Assistance Required

Started by
5 comments, last by Silvo 17 years, 11 months ago
Hi there! I was wondering if anyone had good links for tutorials using SDL with OpenGL. It's for 2D purposes, and I've already tried many, many different places, but few explain anything, most just dump their source onto you, which doesn't help. h you could direct me to where you learnt how to do this (assuming you did), or your typical loading/blitting functions which I could then piece apart. Thanks!
Advertisement
I don't think any articles really cover specifically doing 2D graphics with SDL/OpenGL. However, you can 'combine' a few articles around here to get what you're after, I believe. [smile]

This tutorial covers initializing OpenGL with SDL, and getting the main loop going.

NeHe Lesson 6 covers loading textures and applying them to primitives, which you'll need for any 2D game.

NeHe Lesson 32 covers drawing 2D sprites to the screen, as well as using alpha testing to get rid of the masking colour.

Combined with some other articles sprinkled around the 'net, I'm sure you'll be able to find the rest of the resources you'll need to get a 2D game going with SDL/OpenGL.

Good luck!
Do you mean that you are trying to use OpenGL to do 2d graphics using the SDL framework? If that's the case, just use hxRender to do the cryptic OpenGL stuff for you. You can pick through the source code if you want to but you shouldn't need to. It will give you faster sprite rotations and alpha blending than what you can get using SDL without OpenGL.
Just as an additional little update. Joel (PnP Bios) has found a permanent home for his hxRender and SDL API tutorials.
His google site Since the previous versions of hxRender were crap, he is only supporting version 3 and up. This is where the primitive API documentation is as well. The tutorials will go up later.
thanks for your replys!

I'm checking out hxRender, but the documentation is rather crappy... I looked at aeongames' SDL/OpenGL tutorial before, but after setting it up, it goes no where, pretty pointless really.

But yes, going to have a fddle with hxRender... after reading Code Complete. And doing two assignments, of cause.
Quote:Original post by Silvo
thanks for your replys!

I'm checking out hxRender, but the documentation is rather crappy... I looked at aeongames' SDL/OpenGL tutorial before, but after setting it up, it goes no where, pretty pointless really.

But yes, going to have a fddle with hxRender... after reading Code Complete. And doing two assignments, of cause.


If you need any help seting it up or anything, feel free to post a thread on it. I'm quite familiar with it, so I can help you with it if you need it. A few others around here are familiar with it as well.
yes, a simple example of a C++ program that sets up everything and blits a pic would be lovely. The API is only good if you already understand it...

This topic is closed to new replies.

Advertisement