Page 1 of 1

about opengl wrapper

PostPosted: Fri Mar 11, 2011 10:11 am
by asil
Hi, i'm using dev version for testing and understanding how i can use your product with openframework or opengl. I run wrapper project with visualstudio 2010 properly. I like your product. But i can't draw any thing with opengl while running "DrawGLScene()" method call. When i had commented "DrawGLScene()" call, i would draw somethink. Sample code is below. Do you have any idea? Thanks.

DrawGLScene();

glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(0, 0);
glVertex2f(200, 0);
glVertex2f(200, 200);
glVertex2f(0, 200);
glEnd();

Re: about opengl wrapper

PostPosted: Sat Mar 12, 2011 10:10 am
by Odin_KG
Hi,
I change the some flags of OpenGL in wrapper. For example, you can try to change glDisable(GL_DEPTH); on glEnable(GL_DEPTH); glDepthMask(GL_FALSE);

Re: about opengl wrapper

PostPosted: Mon Mar 21, 2011 12:27 pm
by asil
hi, in wrapper where you enableClientState:
void MP_Frame_WRAP::EndDraw()

i added this code to end of function and it works fine.

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glBindTexture(GL_TEXTURE_2D, 0);
glColor4f(255, 255, 255, 255);

Thanks.

Re: about opengl wrapper

PostPosted: Mon Mar 21, 2011 1:55 pm
by Odin_KG
asil
I am sorry. I was out of time. I am working to release a new version of Magic Particles. The wrapper was modified too. Thank for the help!

Re: about opengl wrapper

PostPosted: Mon Mar 21, 2011 4:24 pm
by asil
you are welcome.
when will you upload new api and wrapper? I can't wait to see it.

Re: about opengl wrapper

PostPosted: Mon Mar 21, 2011 6:04 pm
by Odin_KG
There is informal 3D-version with 3d and 2d API: http://www.astralax.com/hlam/particles_ ... ee_eng.exe
But I will be changing the interface of API yet. The manuals on API and wrapper are old.

Re: about opengl wrapper

PostPosted: Tue Mar 22, 2011 3:08 pm
by asil
Thanks. Can i use Magic_GetDiagramFactor for changing "lineemitter" size?

Magic_GetDiagramFactor(emitter->GetEmitter(), MAGIC_DIAGRAM_DIRECTION, 0);
or
Magic_GetDiagramFactor(emitter->GetEmitter(), MAGIC_EMITTER_LINE, MAGIC_DIAGRAM_DIRECTION);
i tried but didn't work.

how can i do that?

Re: about opengl wrapper

PostPosted: Tue Mar 22, 2011 3:49 pm
by Odin_KG
You need the functions:

Magic_GetDiagramEmitterFactor
Magic_SetDiagramEmitterFactor

Magic_GetDiagramEmitterAddition
Magic_SetDiagramEmitterAddition

For example:
extern HM_EMITTER hmEmitter;
Magic_SetDiagramEmitterAddition(hmEmitter, -1, false, 100);

This code adds 100 to green line of diagram of emitter.
false: green line, true: blue line.

Re: about opengl wrapper

PostPosted: Tue Mar 22, 2011 4:28 pm
by asil
it is working now. thanks a lot.

Re: about opengl wrapper

PostPosted: Tue Mar 22, 2011 4:44 pm
by Odin_KG
you are welcome