mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib/examples: fix gl/glfw/gg examples. rename init functions
This commit is contained in:
committed by
Alexander Medvednikov
parent
b107b4f1e5
commit
dd053d79b0
@@ -25,8 +25,8 @@ pub fn vec2(x, y int) Vec2 {
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn init() {
|
||||
glfw.init()
|
||||
pub fn init_gg() {
|
||||
glfw.init_glfw()
|
||||
println(gl.TEXT_VERT)
|
||||
gl.init_glad()
|
||||
}
|
||||
@@ -78,7 +78,7 @@ pub fn new_context(cfg Cfg) &GG {
|
||||
always_on_top: cfg.always_on_top
|
||||
})
|
||||
window.make_context_current()
|
||||
init()
|
||||
init_gg()
|
||||
}
|
||||
shader := gl.new_shader('simple')
|
||||
shader.use()
|
||||
|
||||
@@ -86,7 +86,7 @@ pub:
|
||||
// type clickpub fn pub fn (window * GLFWwindow, button, action, mods int)
|
||||
type clickpubfn fn (window voidptr, button, action, mods int)
|
||||
|
||||
pub fn init() {
|
||||
pub fn init_glfw() {
|
||||
C.glfwInit()
|
||||
C.glfwWindowHint(C.GLFW_CONTEXT_VERSION_MAJOR, 3)
|
||||
C.glfwWindowHint(C.GLFW_CONTEXT_VERSION_MINOR, 3)
|
||||
|
||||
Reference in New Issue
Block a user