C# graphics.
hey all,
I was learning opengl with C++, when i decided to make a C# pacman for my programming class in school. And im fairly lost because im used to C++/opengl
(which so far i like more, but no need for a flame war.... yet?)
Anyways, the way im drawing to the screen is that i have 2 graphic objects, one from the actual form and another from a bitmap. and i was saving the bitmap to the bg of the form, and recreating the form graphics. at first it thought that it would make it faster bc it doesnt seem to me as though itd take much processing to set a bg.
BUT!!
I still get a flicker. And i dont know how to do this correctly.
Can anyone explain to me a faster way?
Try this:
http://www.bobpowell.net/doublebuffer.htm
http://www.codeproject.com/KB/graphics/DoubleBuffering.aspx
http://www.bobpowell.net/doublebuffer.htm
http://www.codeproject.com/KB/graphics/DoubleBuffering.aspx
If you just want to do this for your class, you'll definitely want to double buffer, as the Mighty Pigeon said. It should be less work to implement that into your existing code than rewriting using OpenGL for C# or XNA.
Just keep in mind that what you're doing is rather slow compared to OpenGL and DirectX. It shouldn't be material for a simple Pac man game, but when you go beyond you should definitely go for XNA as Mike suggested.
Just keep in mind that what you're doing is rather slow compared to OpenGL and DirectX. It shouldn't be material for a simple Pac man game, but when you go beyond you should definitely go for XNA as Mike suggested.
well to my understanding, id have to install the XNA libraries, and the computers at school are heavily restricted.
If i could've used additional graphics libraries, i couldve been done by now.
Also, i already had double buffering on, through the form options, but i followed the directions, and it still flickers. im pretty sure my code is inefficient which im looking into.
but thanks for the help
If i could've used additional graphics libraries, i couldve been done by now.
Also, i already had double buffering on, through the form options, but i followed the directions, and it still flickers. im pretty sure my code is inefficient which im looking into.
but thanks for the help
Maybe you could enlighten us to the specs of your schools PCs. GDI is a slow beast IMO, but if your school is like my previous employment (a training facility), then you have Celeron 666's with some kinda intel integrated graphics thing that can barely play Doom.
http://reviews.cnet.com/desktops/gateway-profile-6-sbb/4507-3118_7-31814646.html?tag=mncol;psum
but even my pc at home which pulls gears of war quite well, was flickering.
but even my pc at home which pulls gears of war quite well, was flickering.
If you're comfortable with OpenGL, you could just use it in C# via Tao.OpenGL: http://www.mono-project.com/Tao
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement