go-gl / gl

Go bindings for OpenGL (generated via glow)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resizing window does not adjust relative coordinates

drakbar opened this issue · comments

commented

So I have a simple triangle geometry like so

+0.0, +0.5, +0.0, // Top
+0.5, -0.5, +0.0,  // Bottom Right
-0.5, -0.5, +0.0,   // Bottom Left

When I first run the program the shape is render as expected.
n

However when I resize the window by either the width or height it appears the origin is no longer centered in the window.

w
h

I expect that the triangle should stay centered in the screen, as the geometry is specified in relative coordinates.

I am not sure what is causing the observed behavior, gl or glfw. Any suggestions as to what is causing this?

commented

@jeff-emanuel Thanks, you were right. I have never used glfw to create a window, and I didn't know that you would need to set up that up also.