We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › GL_ERROR, when no graphics is involved.
Page Index Toggle Pages: 1
GL_ERROR, when no graphics is involved. (Read 855 times)
GL_ERROR, when no graphics is involved.
Sep 6th, 2007, 9:50pm
 
Hi everyone. So i'm having a problem with openGL. this is giving me error on a specific class, with a specific set of function, that have nothing of graphic processing involved. they are more like decision functions, that assign a bunch of numbers to a bunch of variables and arrays.

the error i get is:
GL_ERROR at render_lines in: 0502  GL_INVALID_OPERATION
GL_ERROR at render_lines out: 0502  GL_INVALID_OPERATION
GL_ERROR at render_lines in: 0502  GL_INVALID_OPERATION
GL_ERROR at render_lines out: 0502  GL_INVALID_OPERATION

And well, i would like to know if any of you guys got any kind of error like this. i would be verry thankfull with any  of orientation, because i have no idea of what's happening inside openGL.

Thanks, and stay cool.

[PS Edit] i get that error _every_ time i call those sets of functions. On previous version of this work, i didn't got this errors, and and there is no major change on _those_ functions. even with the previous version functions, i get the same errors on this one.
Re: GL_ERROR, when no graphics is involved.
Reply #1 - Sep 7th, 2007, 3:30pm
 
how about some code that causes the problem?
Re: GL_ERROR, when no graphics is involved.
Reply #2 - Sep 8th, 2007, 11:10pm
 
i am prety much ashamed of my code, because i dont comment much or keep it that clean, please understand.

the exact function that gets that error is:
moves.update( width / 2, 20, HALF_PI);


wich is from the class:
shots_mng moves = new shots_mng();


wich is called into this:
 void update(float pX, float pY, float shipDir)
 {
   refX = pX;
   refY = pY;
   refDir = shipDir;

   repeater();

   if (angMod == 5 || angMod == 7)
   {
     dir = resDir;
   }
   
   drawPoint();
 }
////////////////////////////////////////////////////////////////////////////////
/////////////////
 //VERY TEMPORARY. JUST TO CHECK WERE THE SHOOTING POINTS ARE IN POSITION: relates 3 lines above//
 ////////////////////////////////////////////////////////////////////////////////
/////////////////
 
 void drawPoint()
 {
   stroke(#00FFFF);
   noFill();
   line(refX, refY, refX + cos(refDir)*10, refY + sin(refDir)*10);
   ellipseMode(CENTER);
   stroke(#FF0000);
   ellipse(refX, refY, 7, 7);
 }

for those interested, you can find the code of this class here = http://deci.blindado.net/loliness/shotManaging.txt

i found what the problem was, it was exactly the drawPoint() function. when i took it off there was no longer an error. mos probably because i'm asking to draw outside the stage without a push and pop matrix.

but that's not that important, that update is needed just once, and i dont need it to draw itself, or any other. not now that i've made everything i had to do with them.

but anyway, i found it realy odd because all the ships that use this exact class (more than once sometimes), do this update every frame (its from where the ships shoot their bullets) and it never messes... just with that exact one.

anyway, thanks, and i hope you dont find the code too messy.
anyone can use it in any way. but if you want a better pseudo "particule engine", Kenta Cho's BulletML is way better, and i only tryed to copy him, because i was not able to implement BulletML.
Re: GL_ERROR, when no graphics is involved.
Reply #3 - Sep 9th, 2007, 3:08pm
 
is it possible that refDir, refX or refY are bad values? try using println() to check their values, there might be something weird happening with your math.
Page Index Toggle Pages: 1