libraries for 2D using 3D

Started by
66 comments, last by Kylotan 19 years, 11 months ago
That''s quite nice, except it crashes with 8 bit textures, and it gets the colours wrong on my card, swapping reds and blues.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
Advertisement
I wrote a fairly robust 2D API on top of OpenGL and SDL for ika (a Python-powered game engine, FYI: http://ika.sf.net) Maybe it would be worthwhile to pull it out and make it a standalone library.

Video::Driver* driver = new OpenGL::Driver(640, 480, 32, fullScreen ? true : false);Video::Image* i = driver->createImage(width, height, pixelData);driver->blit(i, x, y);  


(it does other snazzy things like alpha blending and scaling/rotation/blah blah blah enough self aggrandizement for one post)

"Without deviation, progress itself is impossible." -- Frank Zappa

[edited by - the speed bump on May 23, 2004 1:52:21 PM]
"There is only one everything"
quote:Original post by Kylotan
That''s quite nice, except it crashes with 8 bit textures, and it gets the colours wrong on my card, swapping reds and blues.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]


i normally use free image myself, and just thought, hey, sdl has some bmp loader. lets try this for this small lib. i know (and stated a bit above), that opengl doesn''t handle image loading, so you have to do that for yourself. so did i. in a cheap, buggy way. enough to show an image, to show the renderer/painter part works.

i know you can do bether (with a generic you:D). i just got sorta motivated by the request for a library, and the statement "if it is so easy, why can''t someone write one". well.. here it is. but of course, it can be hugely improved.

i''m thinking of a quad that draws as a bezier-quad, so you can have movements like the mac osx windows :D great for a waterfall for example..

then again, you should move directly to the vertices, and then you have full freedom by yourself, to make your 2d world really rock.

or directly go 3d:D



If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

i recently made the switch from SDL to OpenGL, and would agree it would be great to have a simple API for 2d games that was hardware accelerated. basically SDL only it would use full on hardware acceleration. i honestly dont think it would be that hard. i mean, it only took me 4 or 5 days to port my game from using SDL to using OpenGL... its not much of a difference... an SDL_Surface is just a textured quad (i know, i know, its not REALLY one, but you get it..) i honestly dont think it would be that hard to wrap this all up in a nice packagae where you wouldnt even know that you were drawing a textured quad to the screen, instead you were just drawing a surface from a very cool API that someone should make ... using SDL and OpenGL, you could make a really cool cross platform wrapper with easy to use commands... mmm.. if i wasnt such a newbie i would do it
FTA, my 2D futuristic action MMORPG
Maybe I''ll make this my project for the next few days then, to fix up this nice code of Dave''s and make it work properly for me and others.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
The colour problem is in how SDL holds it's colour info. I hate to see so many people reinventing work I and others have already done.. at least use ZEngine as a resource. It's not perfect but it's been aruond a while, and the major bugs (like not loading images colour correctly) have been gone for over a year.

[edited by - cozman on May 24, 2004 6:59:21 AM]
quote:Original post by Kylotan
Maybe I''ll make this my project for the next few days then, to fix up this nice code of Dave''s and make it work properly for me and others.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]


mather of some seconds :D okay, minutes.. just drop in SDL_Image or freeimage, and react on the bitdepth of the image.. (or just convert to the one you want..)



If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Cozman, your two projects look ok but there seems to be a load of stuff that''s not directly relevant to the 2D/3D problem. Picking out the relevant stuff from a library like yours is likely to be more arduous than working from something simple. eg. ZE_ZImage.h depends on ZE_ZEngine.h, which depends on ZE_Defines.h, ZE_Utility.h, ZE_Includes.h, ZE_ZError.h, ZE_ZRandGen.h, VersionInfo.h, etc. It looks great, but it''s too much for my needs.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

This topic is closed to new replies.

Advertisement