last day (32 days later) » 

5:06 PM
There you go
 
Lovely
I was toying with the though of creating an open opengl room while we're at it^^
I haven't really been doing anything more than running examples since the fixed pipeline days
 
What do you want to know?
 
I honestly wasn't thinking anyone would react that quickly. I'm currently in the process of trying to draw a simple triangle, but I fail phenomenally
So right now I'm restructuring what I wrote to find the issue^^
 
Ok, so first of all
What technology are you using?
VBOs or VAOs?
 
both?
creating a VAO with glgenvertexarrays
binding it
 
5:12 PM
So you use the VAOs to store the VBOS
 
ah wait
creating a VBO with glgenbuffers
binding it
filling it with vertices from an array of floats
creating the vao with glgenvertexarrays
binding it
then doing glvertexattribpointer while the vao is bound
unbinding the vao
thats the setup
in my draw loop i clear the color and depth buffers
then bind my vao
 
Just posting the code is enough
 
gldrawarrays
oh that will look fun
do you do java?^^
 
Yeah
That's my primary language for OpenGL
 
lovely
    int vbo;
    int vao;

    @Override
    public void init(GL gl) {
        //1. create VBO with vertice data
        vbo = gl.glGenBuffers(); //allocate buffer on gpu
        gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo); //bind buffer to gl operation
        float[] triangleVertices = {-0.8f, -0.8f, 0.0f,
                                    0.8f, -0.8f, 0.0f,
                                    0.0f,  0.8f, 0.0f};
        gl.glBufferData(GL.GL_ARRAY_BUFFER, triangleVertices, GL.GL_STATIC_DRAW);
 
5:16 PM
Do you use shaders?
 
not at this point
I'm basically only trying to get a white triangle drawn as described here:
upper half is without shaders as far as i understood it
 
What OS do you have? Mac?
That can affect it
 
win
 
Ok, then no problem there
BTW, the first value you pass to the glVertexAttribPointer is actually the vertex attribute you put the VBO in
 
Using GLFW to create window and context. the GL interface i use is synthesized from lwjgl's generated GL## classes and passed through from my backend
hmm that might help
 
5:19 PM
It's currently ok
 
I was just in the process of rewriting yeah. I'll give it a spin then
 
Basically, a VAO has 16 slots, these are the vertex attributes
Put a piece of error checking in the game loop
 
good call
got a snippet?
 
int error = GL.glGetError();
while (error != GL.GL_NO_ERROR)
    System.out.println(error);
    error = GL.glGetError();
 
thanks
 
5:21 PM
It prints out a number, around 65000 (I think) if it's a buffer error
 
great i'll give it a spin
it's throwing a beautiful access violation, so I've messed up something in my reafctoring
messed up something in my window creation... I'll eventually be back
 
5:56 PM
do you know by chance: is there any drawback in calling GL.createCapabilities() every frame?
 
I think it has a return in it, if the current capability is the one belonging to the window
So maybe nanoseconds
 
yeah i just realised it's probably rather makeContextCurrent from glfw that I need
I refactored my view interface to allow setting it up and tearing it down when it is assigned/unassigned to/from a window. so now I have the issue that I need to pass the context back and forth - took me way too long to find that issue^^
 

  last day (32 days later) »