opengl. few stupid questions.

Monkey Forums/Monkey Programming/opengl. few stupid questions.

Paul - Taiphoz(Posted 2012) [#1]
How is monkey drawing the 2D stuff to convasas and such at the moment, my games 2D using all the normal monkey 2D stuff but I was wondering how easy it would be to take my existing code and get it to use opengl.

my thinking is that I might get a boost in speed, as well as a bit more control over how the graphics look.

not touched opengl in monkey yet so opengl noob here.


Samah(Posted 2012) [#2]
The Android Mojo target already uses OpenGL ES for 2D, and I'm pretty sure the same goes for iOS. By definition, GLFW is OpenGL.

For those targets at least, I very much doubt you're going to get any kind of 2D optimisations, as Mark has done it all for you in the translated code.

HTML5 uses canvas drawing by default, but I'm not sure how mojo works for other targets.


therevills(Posted 2012) [#3]
Samah's right:

Android: OpenGL
iOS: OpenGL
GLFW: OpenGL
HTML5: HTML5 Canvas
Flash: Flash Canvas ;)
XNA: DirectX


AdamRedwoods(Posted 2012) [#4]
mojo is well optimized, and it leaves other optimizations to the user by:
- using texture atlases
- drawing all your sprites that use the same atlases in groups


JIM(Posted 2012) [#5]
If you wanna go hardcore mode, you can get a few optimizations, but not that many.

However, you can get new features (like multitexturing, shaders, all kinds of special effects) assuming you're talking about OpenglES 2.0.

If you're strictly looking for speed, it's not worth it. If you wanna write your own engine for 2D and use as many features of OpenGL as you want, go for it :) Just know that it will take a while to even get what mojo has now.


Paul - Taiphoz(Posted 2012) [#6]
Ah thanks for all the info guys.