go-gl-legacy / gl

Go bindings for OpenGL
BSD 3-Clause "New" or "Revised" License
342 stars 52 forks source link

sdl + gl.Init() crash #178

Closed Triangle345 closed 9 years ago

Triangle345 commented 9 years ago

I'm not sure if this is a go-gl issue or a user issue but whenever i try to do gl.Init() I get kicked back to the prompt with a message of "exit status 3221225781"

I notice that when I remove the gl.Init() from the code below I at least see the sdl window. Has anyone else had this issue?

var window *sdl.Window
var context sdl.GLContext
var event sdl.Event
var running bool
var err error
runtime.LockOSThread()
if 0 != sdl.Init(sdl.INIT_EVERYTHING) {
    panic(sdl.GetError())
}
window, err = sdl.CreateWindow(winTitle, sdl.WINDOWPOS_UNDEFINED,
    sdl.WINDOWPOS_UNDEFINED,
    winWidth, winHeight, sdl.WINDOW_OPENGL)
if err != nil {
    panic(err)
}
if window == nil {
    panic(sdl.GetError())
}
context = sdl.GL_CreateContext(window)
if context == nil {
    panic(sdl.GetError())
}

if gl.Init() != 0 {
    panic("gl error")
}
Triangle345 commented 9 years ago

figured out the issue... I had to put glew and sdl dll within the executable folder.