about opengl wrapper

All information about Magic Particles: news, question, comments, etc.

about opengl wrapper

Postby asil » Fri Mar 11, 2011 10:11 am

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();
asil
 
Posts: 6
Joined: Fri Mar 11, 2011 9:57 am

Re: about opengl wrapper

Postby Odin_KG » Sat Mar 12, 2011 10:10 am

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);
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: about opengl wrapper

Postby asil » Mon Mar 21, 2011 12:27 pm

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.
asil
 
Posts: 6
Joined: Fri Mar 11, 2011 9:57 am

Re: about opengl wrapper

Postby Odin_KG » Mon Mar 21, 2011 1:55 pm

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!
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: about opengl wrapper

Postby asil » Mon Mar 21, 2011 4:24 pm

you are welcome.
when will you upload new api and wrapper? I can't wait to see it.
asil
 
Posts: 6
Joined: Fri Mar 11, 2011 9:57 am

Re: about opengl wrapper

Postby Odin_KG » Mon Mar 21, 2011 6:04 pm

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.
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: about opengl wrapper

Postby asil » Tue Mar 22, 2011 3:08 pm

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?
asil
 
Posts: 6
Joined: Fri Mar 11, 2011 9:57 am

Re: about opengl wrapper

Postby Odin_KG » Tue Mar 22, 2011 3:49 pm

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.
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm

Re: about opengl wrapper

Postby asil » Tue Mar 22, 2011 4:28 pm

it is working now. thanks a lot.
asil
 
Posts: 6
Joined: Fri Mar 11, 2011 9:57 am

Re: about opengl wrapper

Postby Odin_KG » Tue Mar 22, 2011 4:44 pm

you are welcome
User avatar
Odin_KG
Administrator
Administrator
 
Posts: 255
Joined: Sat May 09, 2009 10:53 pm


Return to Magic Particles

Who is online

Users browsing this forum: No registered users and 8 guests

cron