Sign in to follow this  
Silvo

SDL and OpenGL Assistance Required

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this