decinoge
YaBB Newbies
Offline
Posts: 21
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.