We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Just a personal experiment, no rush with reply.
I would like to access PGraphics and disable SwapBuffers in Processing. The goal is to write my own draw function, coding in JOGL i never know, what's to proper way to manage my JOGL call stack.
good chances that i can manage it on my own, the simpler version related to that question:
What is the proper way to access the default PGraphics. I know their some Java guys out here knows the answer.
Don't let me search in the forum, the answers is somewhere out their, - i know.
In case you have some JOGL knowledge:
Or is it so that the FPSAnimator is bound to the draw function?
Thanks for the reply.
*.pde to play with
// should be contentiously red
import com.jogamp.opengl.GL4;
import com.jogamp.opengl.util.GLBuffers;
void settings() {
size(640, 360, P3D);
PJOGL.profile = 4;
}
void setup() {
GL4 gl4 = ((PJOGL)beginPGL()).gl.getGL4();
gl4.glClearBufferfv(GL4.GL_COLOR, 0, GLBuffers.newDirectFloatBuffer(4).put(0, 1f).put(1, 0f).put(2, 0f).put(3, 1f));
endPGL();
frameRate(1);
}
Answers
I'm not sure I understand what you mean (I am not a JOGL expert), but the main PGraphics in Processing is named
g
in each renderer. See for example:https://github.com/processing/processing/blob/master/core/src/processing/awt/PShapeJava2D.java#L349
Is that what you are asking?
Hello @jeremydouglass
do you know how to acess ATW ?
To make this line work:
Here is the jogl line in processing, but i dont think this is the root of the "bug"
https://github.com/processing/processing/blob/master/core/src/processing/opengl/PJOGL.java#L292
So it's not implemented yet ?
https://github.com/processing/processing/blob/0abee5af6ad3b11cf2b73bb794b8a97c157c4762/core/README.md#questionsto-do
I'm honestly not sure who on the forum could advise you about this. Perhaps @koogs or @kfrajer might have some idea? Or maybe @codeanticode?
@jeremydouglass Got it!
makeCurrent - was what i searching for.
Also found this, i should be fine for the next months https://github.com/codeanticode/jogl2-tests
@nabr Is this related to your shader's work? No clue about any of this... but more curious about what advantages do you get by going this way. Would these be along the lines of GPU programming?
Kf
Hello @kfrajer
Yes, it's related to my shader work. Becourse we now in 2017 and i'm progressive and try to get the latestes specs on OPENGL to work in Processing JOGL.
(don't what to upset anyone but -) this looks a bit like back in the 90ties: https://github.com/processing/processing/wiki/Advanced-OpenGL
pgl.gl.getGL2ES2() which is also coming to age.
I never know at witch point what is exactly going on in my code.
I just need more control, to write smart code.
The setup -> draw method get me always on a path of guessing.
not always sure, what is running in the background - processing and i'm already at low level, so i find myself looking up for things implemented in processing more then code.
and as i said a personal experiment how much it would take to disable the draw method swapBuffer.
Thank you all for help
Consider tagging @T_D and @neilcsmith_net as they could potentially help as well as @prince_polka and @Lord_of_the_Galaxy.
Kf
Rather embarrassing but I have forgotten pretty much everything that I learnt about shaders :P