Hi,
I want to write a new Geo.
Looking for a tutorial, I found the documentation at gem/doc/manual/WriteCode.html which essentially says "use the source, Luke". But 140k lines of code are quite daunting...
Where should I start?
I need 3 methods, respectively called after OpenGL context creation, at render time, and before context destruction.
Thanks,
Claude
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-10-29 13:39, Claude Heiland-Allen wrote:
Hi,
I want to write a new Geo.
Looking for a tutorial, I found the documentation at gem/doc/manual/WriteCode.html which essentially says "use the source, Luke". But 140k lines of code are quite daunting...
ahja, this document has not been touched since i took over Gem 13 or so years ago...
Where should I start?
derive your object-class from GemBasse
I need 3 methods, respectively called
after OpenGL context creation,
virtual void startRendering();
at render time
virtual void render(GemState *state);
and before context destruction.
virtual void stopRendering();
to there's also a virtual bool isRunnable(); that get's called (usually once) for each context so you can add some checks whether the current openGL-context provides everything you need: if isRunnable() returns FALSE, the object will not be part of the rendering chain. (this is mainly to prevent continuous triggers of invalid calls)
start/stopRendering is not really tied to context creation/destruction but to turning rendering on/off (which has been enough for most use-case so far) once the multi-context support is finished, stopRendering() will also be called if a context is destroyed.
in order to make your object multi-context aware, you should use gem::ContextData for any per-context variable.
something like: gem::ContextData<GLenum>m_id;
in most cases, you can use `m_id` just as if it was a GLenum (that is: the template-argument type), but it will hold a different value for each context.
hope this helps.
fgmasdr IOhannes