help:Anyone use SDL?

Discussion about everything. New games, 3d math, development tips...
Post Reply
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

help:Anyone use SDL?

Post by Virion »

I am currently doing a 2D side-scrolling game with SDL. I got some problems with animation: i want to to animate from frame 1 to 4 but it stopped at frame 2. :shock:

my code is shown here: http://www.gamedev.net/community/forums ... _id=466869

Please help. :(
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I'm not familiar with SDL but from looking at your playAnimation function it seems a little strange that you set currentFrame to startFrame each time you call that function, is that correct or should that only be done once?
Image Image Image
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

The problem solved, but more problems occurred. Man I feel like I'm doing a 2D engine not a game! Does Irrlicht fits my needs to make a 2D game? But there are so little guides about making 2D games with Irrlicht here.

Btw SDL kinda slow even though it is rendering 2D images. When rendered for like 10 seconds it started to get laggy. :evil:
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post by shogun »

Virion wrote:Btw SDL kinda slow even though it is rendering 2D images. When rendered for like 10 seconds it started to get laggy. :evil:
You probably do something bad with your surfaces.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

What are you using irrlicht for if you're using SDL to do all the graphics? Just to load textures?

In which case it's probably your SDL code that's causing the lag and not irrlicht.
Image Image Image
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

No, I mean, probably will switch the whole thing to Irrlicht.

SDL alone is pretty slow. The only advice people would give me is combining SDL with openGL. But hey I want to make a game and finish it fast, not constructing a rendering engine!
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Virion wrote:No, I mean, probably will switch the whole thing to Irrlicht.
Then why do you care about an SDL problem? ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Virion
Competition winner
Posts: 2149
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

rogerborg wrote:
Virion wrote:No, I mean, probably will switch the whole thing to Irrlicht.
Then why do you care about an SDL problem? ;)
No that was before I thought of switching to irrlicht.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

JP wrote:I'm not familiar with SDL but from looking at your playAnimation function it seems a little strange that you set currentFrame to startFrame each time you call that function, is that correct or should that only be done once?
as far as I know only once... basing that on a simple demo I saw once.

@V - I find it rather comical that you're asking about SDL on irrlicht but never the less I'll do my best to help.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

SDL.. is basic.. Irrlicht does what it does for the most part and more.

I wouldn't recommend SDL for 99.9% of projects based on my very limited knowledge of SDL.

as for 2d and side scrolling type games... maybe you can find more info on the wiki on 2d animation in irrlicht and also I recommend you take a glance at the magic 2d library.

searching irrlicht forums for "2d" would probably produce some very interesting results as it's not really talked about all that often.

also I highly recommend you try my search engine it can be extreamly useful taking priority of some 18 or more well known game development sites.

this is your brain 0
this is your brain on SDL _
Post Reply