Drawing many 2D Pixels

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Gurkenlaster

Drawing many 2D Pixels

Post by Gurkenlaster »

Hi,
I'm making a 2D Game with Irrlicht.
Now i want to draw many single pixels (a little 2D-Particle Engine ;) )
Whats the fastest way to do this?
Currently i am using "draw2DImage"

Code: Select all

pApp->driver->draw2DRectangle( particle[i].color, core::rect<s32>( particle[i].pos.X+0, particle[i].pos.Y+0, particle[i].pos.X+particle[i].size.X, particle[i].pos.Y+particle[i].size.Y), 0 );
This works good, but issnt there a way to do it Faster, so i can draw more pixels and keep the Framerate high? :?

Thx
Gurkenlaster
tip
Posts: 50
Joined: Fri Feb 13, 2004 8:53 am
Location: grenoble, France
Contact:

Post by tip »

maybe you could use a texture with many dots; and apply this texture on fading / growing triangles around the particle emitting point. maybe disable mipmapping to avoid simply gray triangles when they're small
surfordie6

Post by surfordie6 »

For 2D programming, I recommend checking out CDX http://www.cdxlib.com its a really easy 2D game library for C++. Not that Irrlicht can't do it, but I think irrlicht is geared much more for 3D. Anyway, in CDX you would Lock the surface, then call functions like Screen->GetBack()->PlotPixel(x, y, RGB(255, 0, 0));

I've made a particle engine using the above technique and its quite fast, up around the standard 60 FPS even with layers in the background moving. The most I've done in 2D with irrlicht, is just bitmap animation.
LoganGrimnar
Posts: 8
Joined: Sat Jun 19, 2004 2:13 am

Post by LoganGrimnar »

surfordie6 wrote:For 2D programming, I recommend checking out CDX http://www.cdxlib.com its a really easy 2D game library for C++. Not that Irrlicht can't do it, but I think irrlicht is geared much more for 3D. Anyway, in CDX you would Lock the surface, then call functions like Screen->GetBack()->PlotPixel(x, y, RGB(255, 0, 0));

I've made a particle engine using the above technique and its quite fast, up around the standard 60 FPS even with layers in the background moving. The most I've done in 2D with irrlicht, is just bitmap animation.
(First: I am the Treatstarter, but now withe a registred name :D )

I like the Irrlicht Engine, and want develop 3D Games. But i want to start first with a small 2Dthing to learn the Basics and the 2D-Part of the Engine.
Now i try to make a Breakout, but not a simple 2D-Standard-Game.
So i made a litte 2D-particle Engine to use in the Game.

Here is a little Demo of it:
http://www.Thurand.de/downloads/Firework.rar(irrlicht.dll not included)

It have 2 Scenes (Firework/Starfield)
A Console
It can draw simple pixels and textured Particles.
Tu show the Console type "^" (on the Germen Keyboard)
some commands:
/show info 1 (shows FPS)
/exit
/console
/set state game (shows starfield scene)
/set state menu (shows firework scene)

Could you test it, and tel me if the Performance is OK ?
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Sometimes it drops from 250 to 130 but it doesn't go lower here :)

Barton 2600+, 512mb ram, Radeon 9600xt
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

If all partixels (3072) are drawn framerate drops to about 70. Average 200-300. Max ~500.
Starfield ~170.

2000+, 1GB RAM, Radeon 2800 Pro
Guest

Post by Guest »

how about write all those pixels to a texture and only print the texture to the screen?
LoganGrimnar
Posts: 8
Joined: Sat Jun 19, 2004 2:13 am

Post by LoganGrimnar »

Anonymous wrote:how about write all those pixels to a texture and only print the texture to the screen?
Hm, i could try this, have you any linkt to a good tutorial or something for me about this?
Logan Grimnar

Post by Logan Grimnar »

Hm ... i dont find any infos with google. how can i draw pixels to a texture? Any Tips?
Post Reply