Pages: 1
  Print  
Author Topic: [Question] Exporting to C++ or accessing OpenGL bindings, is it possible?  (Read 1105 times)
Offline (Unknown gender) CubeGod
Posted on: August 16, 2013, 09:14:55 PM
Member
Joined: Aug 2013
Posts: 5

View Profile
So, I am developing for the Ouya and I really want to optimize my game as much as possible, the main issue I am having is a slight overdrawing issue which would be solved either through VBO (but reading the documentation this is already implemented) or by reducing the size of the pixel buffer, say I want to render to a 960*540 or  even a 420*270 pixel buffer, what would be the most efficient way of doing this from enigma?

I would prefer if saving the project to c++ would be possible (hell, you tell g++ to compile it so you must be converting the GML / C++ soup to valid C++ (the AI programmer writes in GML and I write in C++ to clarify, I am the graphics programmer btw and I have the greatest limitations on me since the Tegra 3 GPU isn't exactly powerful)

If this is not possible can one access raw OpenGL bindings from the engine?
Logged
Offline (Male) Josh @ Dreamland
Reply #1 Posted on: August 16, 2013, 10:00:36 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
ENIGMA's exported C++ is extremely ugly; you won't want to work with it. However, you can work directly with OpenGL by #include'ing it from ENIGMA's Definitions. Open ENIGMA settings, click the Definitions button at the bottom, and enter #include <GL/gl.h> in the code. Unless you save as EGM, your team will need to do the same to use your code.

From there, you can use any OpenGL function ENIGMA can read, which, last I checked, includes all of them.

We normally don't recommend doing that, as it isn't portable; that is, you're stuck with OpenGL on all systems that way. Have you considered creating wrapper functions for the calls you need? Wrapper functions can be ported to other APIs, and odds are, if you find them useful, so will others. That being the case, assuming your needs are reasonably general, we might consider adopting them as part of the official API (meaning, include them in the DirectX port, along with others), if you'd like to share.
« Last Edit: August 16, 2013, 10:02:07 PM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) CubeGod
Reply #2 Posted on: August 16, 2013, 11:36:49 PM
Member
Joined: Aug 2013
Posts: 5

View Profile
I will make a wrapper later on but right now I only need access to a few OpenGL functions (the Ouya uses OpenGL ES 2.0 which, for what I need, is 100% compatible) as this is only for an internal test build and it doesn't really matter if the rest of the team can't use this right now as my environment is the best suited for building the final binaries on (I have all the cross compilers installed and set up, something the other member doesn't), when I do write such a wrapper I will share it as I firmly believe that FOSS is a good thing and I would love to contribute some.


Oh and on a side not, I am aware the code would be ugly and unpleasant to work with (I have had to decipher my share of obfuscated code), and besides being stuck with OpenGL isn't necessarily a bad thing, it runs on most platforms and isn't really a problem in that sense.
Logged
Offline (Unknown gender) TheExDeus
Reply #3 Posted on: August 17, 2013, 05:51:38 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
The converted code is in ENIGMAsystem\SHELL\Preprocessor_Environment_Editable.

Also, we want to make a GLES port, but it is not really going anywhere. The idea now is to convert GL3 to use only non-deprecated functions and that would allow much easier conversion to GLES.
Logged
Offline (Unknown gender) CubeGod
Reply #4 Posted on: August 17, 2013, 10:36:10 AM
Member
Joined: Aug 2013
Posts: 5

View Profile
Oh?
Well, if all else fails I should be able to work with the ugly code, although so far my OpenGL functions run fine, I actually expected the engine to fight  a bit (as engines tend to do) but it went smoother than expected.
Logged
Pages: 1
  Print