
2D Graphics Engine
Posted Monday, 4 February, 2008 - 21:07 by lubos inOverview
Hello, so I'm slowly progressing with my OpenTK, OpenGL and whole C# adventure. I'm taking opportunity to start development diary so here I am :) I have started writing a small engine with OpenTK, that handles ONLY 2D rendering, but completely removes need to use any OpenGL function, while cooperating with other parts of OpenTK. I haven't decided for the name yet but that's not important I think.
The goal is to build a small, easy to use engine capable of building small 2D games together with OpenTK.
Engine doesn't use any scene-graph, you must draw each image every frame manually. I think this way it's cleaner and faster when working with 2D graphics. However, Gui uses a GuiManager which will draw all widgets at once.
To use engine, engine code is linked directly with game code. If you don't need some parts of engine you just don't link them.
The colors are passed as unsigned bytes (0-255).
The positions and sizes are passed as integers, meaning the x and y position of pixel on screen, where 0,0 is in the top left part of the screen.
Features implemented:
- Images loading/drawing (rotating, scaling, blending, drawing part of image)
- Animations(Sprite) (frames rendered from one texture, same options as image)
- Particle systems (uses single VBO, Point sprites)
- Custom VBOs
Features planned:
- Basic Gui(first widgets done)
- Complete documentation/examples(some examples done)
- Shaders
| Attachment | Size |
|---|---|
| Mines.zip | 464.13 KB |
| PointSprites.zip | 467.25 KB |
| Game.zip | 476.52 KB |
| Engine.zip | 23.6 KB |







Comments
Re: 2D Graphics Engine
I have removed all textPrinter.End(); calls and everything is displayed ok again
Re: 2D Graphics Engine
New features! Now when VBOs aren't supported, intermediate mode is used instead. Also point sprites are done, see new screen or try attached application. It uses 15k particles and runs on 76 fps here :)
Re: 2D Graphics Engine
The new particles are great, especially the second screenshot!
Re: 2D Graphics Engine
I have coded another small game. The menu is not yet finished, but it does all that I wanted it to do. While coding this game I have found many things which was missing in engine, but I think it's getting better :) The next thing on the list is a Group class, that can modify all objects added to it at once, like move them or rotate them. And the Effect class for shaders.
Re: 2D Graphics Engine
Hello! I'm still updating engine. I will upload code tommorow, maybe someone can find it useful. It's still missing some nice things which I'm planning but I hope to implement them all sometimes. Added a screenshot of my current project using engine, I'm trying this one: http://lostgarden.com/2008/06/shade-game-design-challenge.html .