SRL Archive - Game Development

C# graphics


m34tcode

2014-03-28 18:50:35

I am writing a game in C#, similar to bejeweled but on a hexagonal grid, and I am curious what the best and most efficient way to handle graphics is.

Currently I am using a GraphicsBuffer and drawing to that when there is an update, invalidating the area that needs to be redrawn, and redrawing that portion of the buffer in the paint event handler.

This is really slow and I get like 15 - 20 Fps if only updating the small area. Updating the whole window forces that down to around 2 Fps.

Kasi

2014-03-28 20:04:00

Use DirectX

m34tcode

2014-03-28 23:06:47

Ah, great idea! I am planning on porting to Java then Android so I will use OpenGL, and I am sure that will increase the speed. Thanks! :-)

masterBB

2014-05-19 06:28:32

A little late. But I suggest monoGame.

x[Warrior]x3500

2014-05-19 20:58:18

with masterBB's suggestion i would also add:

for openGL and c# - opentk

for a great game engine (most popular one atm) - unity

masterBB

2014-05-20 02:11:11

From: x[Warrior]x3500
for openGL and c# - opentk


monoGame is a wrapper for both openTK and sharpDX

x[Warrior]x3500

2014-05-20 12:27:43

Well, that's a TIL. :) thanks for the info!

EDIT: i thought monogame used the tao framework xD

m34tcode

2014-05-21 10:04:40

Yea, I tried multiple libraries, but ended up going with OpenTK, since the higher level libraries are missing important elements, like rotation and scaling or antialiasing. I will look at monogame, if it is cross platform. I will be porting this to android.