Giter Site home page Giter Site logo

Comments (6)

tapir avatar tapir commented on June 3, 2024

I've changed the GL wrapper and it seems to work OK.
I don't know if the problem is on GLFW or GL side but I will investigate it further.
Maybe you can open a ticket to gogl project and link here?

    package main
    import (
        glfw "github.com/tapir/glfw3-go"
        "github.com/go-gl/gl"
        //"runtime"
    )
    func main() {
        //runtime.LockOSThread()
        if !glfw.Init() {
            println("glfw init failure")
        }
        defer glfw.Terminate()
        //glfw.SetErrorCallback(func(err int, desc string) { panic(desc) })
        window := glfw.CreateWindow(500, 500, "egles", nil, nil)
        defer window.Destroy()
        window.MakeContextCurrent()
        for {
            if window.ShouldClose() {
                break
            }
            width, height := window.GetSize()
            ratio := float64(width) / float64(height)
            //println(window.GetParameter(glfw.ClientApi))
            gl.Viewport(0, 0, width, height)
            gl.Clear(gl.COLOR_BUFFER_BIT)
        
            gl.MatrixMode(gl.PROJECTION)
            gl.LoadIdentity()
            gl.Ortho(-ratio, ratio, -1.0, 1.0, 1.0, -1.0)
            gl.MatrixMode(gl.MODELVIEW)
            gl.LoadIdentity()
            gl.Rotatef(float32(glfw.GetTime()*50), 0, 0, 1.0)
            gl.Begin(gl.TRIANGLES)
                gl.Color3f(1.0, 0.0, 0.0)
                gl.Vertex3f(-0.6, -0.4, 0.0)
                gl.Color3f(0.0, 1.0, 0.0)
                gl.Vertex3f(0.6, -0.4, 0.0)
                gl.Color3f(0.0, 0.0, 1.0)
                gl.Vertex3f(0.0, 0.6, 0.0)
            gl.End()
            window.SwapBuffers()
            glfw.PollEvents()
        }
    }

from glfw.

mortdeus avatar mortdeus commented on June 3, 2024

I can confirm go-gl/gl works (though its kinda irritating to build right now). No idea why gogl doesnt work but for my specific use case it wont really matter anyways considering im using egl/gles.

from glfw.

tapir avatar tapir commented on June 3, 2024

You mean because of "glew" dependency?
Does go-gl/gl support gles or not?

from glfw.

mortdeus avatar mortdeus commented on June 3, 2024

Nope go-gl/gl only works with opengl.

Ive been working on EGL/GLES wrappers in my project egles(http://github.com/mortdeus/egles). The only setback is that mesa's egl implementation only supports xlib.h's display, window and pixmap types as of right now. If mesa had builtin support for xcb, we could just use burntsushi's xgb bindings to pass in as an EGLDisplay. Unfortunately it doesnt which would require wrapping xlib with cgo and thats just horrible.

Thats pretty much why im looking into glfw3.

from glfw.

tapir avatar tapir commented on June 3, 2024

Maybe you can use opengl 3.2 core profile until this issue figured out? AFAIK It's almost a strict superset of esgl.

from glfw.

tapir avatar tapir commented on June 3, 2024

http://play.golang.org/p/03RkIRH0qV

this seems to work ok as well (uses chsc/gogl) so I'm closing this bug.

from glfw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.