[help OpenGL]

576 views
Skip to first unread message

gta

unread,
Jun 29, 2012, 10:19:16 AM6/29/12
to golan...@googlegroups.com
Hi,
I had some free time to play with OpenGL again.
I'm using the work branch of the banthar bindings.
Following this thread I changed the gl.Init function to

func Init() GLenum {
    C.glewExperimental=C.GL_TRUE
    return GLenum(C.glewInit())
}

so the attached code compiles and run but does not display anything.

Anyone knows what am i doing wrong?

Thanks.



gltut.go

Jonathan Wills

unread,
Jun 29, 2012, 2:49:51 PM6/29/12
to gta, golan...@googlegroups.com
Well depending on your graphics card the fact that you don't set 

  gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;

in your fragment shader might be a problem.  I don't see anything else that immediately jumps out at me though.

Jonathan Wills

unread,
Jun 29, 2012, 2:50:13 PM6/29/12
to gta, golan...@googlegroups.com
On Fri, Jun 29, 2012 at 11:49 AM, Jonathan Wills <runni...@gmail.com> wrote:
Well depending on your graphics card the fact that you don't set 

  gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;

in your fragment shader might be a problem.  I don't see anything else that immediately jumps out at me though.
 
I meant vertex shader, not fragment shader.

gta

unread,
Jul 24, 2012, 4:20:46 PM7/24/12
to golan...@googlegroups.com, gta
Thanks for the reply (and sorry for my late one),
I tried to add that line but I got the following errors:

ERROR: 0:6: Use of undeclared identifier 'gl_ClipVertex'
ERROR: 0:6: Use of undeclared identifier 'gl_ModelViewMatrix'
ERROR: 0:6: Use of undeclared identifier 'gl_Vertex'

I guess because I'm trying to use #version 330
Any other idea?

Thanks in advance.

Giacomo

Christoph Schunk

unread,
Jul 25, 2012, 6:05:21 AM7/25/12
to golan...@googlegroups.com, gta
 gl_ModelViewMatrix is deprecated.  With OpenGL 3 you have to handle the matrices yourself (via Uniforms). Have a look at GLM http://glm.g-truc.net/ for an OpenGL compatible matrix implementation. You could port the matrix stuff to Go.

gta

unread,
Jul 26, 2012, 10:45:00 AM7/26/12
to golan...@googlegroups.com, gta
Hi,
and thanks for the link.
I think this is basically what I was trying to learn from the tutorial I linked in the first post, but I get only a blank window. 
I can change the clear color but anything drawn with the shader is not displayed, and being a total n00b I have no clue on what can possibly be wrong (I was expecting a more evident reason of failure, compilers screaming in pain and what not).
Is it possible that the problem is compiling a shader with #version 330 in an OpenGL 3.2 context? 
How is it even possible anyways?


Giacomo
Reply all
Reply to author
Forward
0 new messages