C++ 2D Shooter project (Htbaa's Worklog)

Build on C++ with SDL and KrasEngine! RSS Feed
Worklogs > Htbaa's Worklogs > C++ 2D Shooter project > Using OpenGL for rendering

Using OpenGL for rendering

Not much progress on the 3rd milestone because I decided to switch to OpenGL rendering. Sandman talked me into it (well, I had it planned anyway but he said it wouldn't be that much work).

Well, the little work needed took a few days :-). Mainly because rendering wasn't working on my laptop. On my *new* computer (with a decent graphics card) using Ubuntu and on the other new computer using Vista the graphics rendered fine. For some reason all I would get on my laptop were white squares.

After a lot of testing, taking a look at other, working, examples I was almost at a loss. I did the exact same thing as in the examples I found online. The only thing I didn't exactly do the same was the size of my textures. Turned out to be both width and height have to be a power of 2. Of course, none of my graphics had the right dimensions :-).

So after sorting that one out I finally had it working on my laptop. Why did the textures have to had a dimension with a power of 2? Well, newer graphic cards don't care about it. But the Intel Extreme Graphics II integrated graphics card on my laptop does care. So I consider it a good thing that I develop on 2 systems. Because the game will still work on other low-end machines.

Rendering using OpenGL currently works. All I have to do now is keep my engine SDL Software rendering compatible so I can switch back to software rendering if I need to. I might need it when I decide to port the game to the PSP. But for the PC I'll use OpenGL and I don't think it can hurt to keep software rendering. I can always fall back to it.

I still need to figure some stuff out with OpenGL. Like how to set the colorkey to make the background of a sprite transparent and I also need to kick back alpha blending in.

Once I can do all with OpenGL as I could with SDL then it's time to create 2 rendering options: Software rendering and OpenGL rendering. After that, it's time to finish Milestone 3 and get on with it!
(Posted on April, 13th 2008, 17:39)

Comments

There are no comments.

Post New Comment

You must log in or register to post comments.

Worklogs > Htbaa's Worklogs > C++ 2D Shooter project > Using OpenGL for rendering
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!