mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
force snake_case in variable names
This commit is contained in:
16
vlib/gg/gg.v
16
vlib/gg/gg.v
@ -107,9 +107,9 @@ pub fn new_context(cfg Cfg) *GG {
|
||||
// i := glm.identity3()
|
||||
shader.set_mat4('projection', glm.identity())
|
||||
}
|
||||
VAO := gl.gen_vertex_array()
|
||||
vao := gl.gen_vertex_array()
|
||||
//println('new gg context VAO=$VAO')
|
||||
VBO := gl.gen_buffer()
|
||||
vbo := gl.gen_buffer()
|
||||
mut scale := 1
|
||||
if cfg.retina {
|
||||
scale = 2
|
||||
@ -126,8 +126,8 @@ pub fn new_context(cfg Cfg) *GG {
|
||||
shader: shader
|
||||
width: cfg.width
|
||||
height: cfg.height
|
||||
VAO: VAO
|
||||
VBO: VBO
|
||||
VAO: vao
|
||||
VBO: vbo
|
||||
// /line_vao: gl.gen_vertex_array()
|
||||
// /line_vbo: gl.gen_buffer()
|
||||
//text_ctx: new_context_text(cfg, scale),
|
||||
@ -272,11 +272,11 @@ fn todo_remove_me(cfg Cfg, scale int) {
|
||||
// projection_new := ortho(0, width, 0, height)// 0 at BOT
|
||||
// projection := gl.ortho(0, width,height,0) // 0 at TOP
|
||||
shader.set_mat4('projection', projection)
|
||||
VAO := gl.gen_vertex_array()
|
||||
vao := gl.gen_vertex_array()
|
||||
//println('new gg text context VAO=$VAO')
|
||||
VBO := gl.gen_buffer()
|
||||
gl.bind_vao(VAO)
|
||||
gl.bind_buffer(GL_ARRAY_BUFFER, VBO)
|
||||
vbo := gl.gen_buffer()
|
||||
gl.bind_vao(vao)
|
||||
gl.bind_buffer(GL_ARRAY_BUFFER, vbo)
|
||||
gl.enable_vertex_attrib_array(0)
|
||||
gl.vertex_attrib_pointer(0, 4, GL_FLOAT, false, 4, 0)
|
||||
}
|
||||
|
24
vlib/gl/gl.v
24
vlib/gl/gl.v
@ -87,15 +87,15 @@ pub fn delete_shader(shader int) {
|
||||
}
|
||||
|
||||
pub fn shader_info_log(shader int) string {
|
||||
infoLog := [512]byte
|
||||
C.glGetShaderInfoLog(shader, 512, 0, infoLog)
|
||||
return tos_clone(infoLog)
|
||||
info_log := [512]byte
|
||||
C.glGetShaderInfoLog(shader, 512, 0, info_log)
|
||||
return tos_clone(info_log)
|
||||
}
|
||||
|
||||
pub fn get_program_info_log(program int) string {
|
||||
infoLog := [1024]byte
|
||||
C.glGetProgramInfoLog(program, 1024, 0, infoLog)
|
||||
return tos_clone(infoLog)
|
||||
info_log := [1024]byte
|
||||
C.glGetProgramInfoLog(program, 1024, 0, info_log)
|
||||
return tos_clone(info_log)
|
||||
}
|
||||
|
||||
pub fn bind_vao(vao u32) {
|
||||
@ -166,9 +166,9 @@ pub fn use_program(program int) {
|
||||
}
|
||||
|
||||
pub fn gen_vertex_array() u32 {
|
||||
VAO := u32(0)
|
||||
C.glGenVertexArrays(1, &VAO)
|
||||
return VAO
|
||||
vao := u32(0)
|
||||
C.glGenVertexArrays(1, &vao)
|
||||
return vao
|
||||
}
|
||||
|
||||
pub fn enable_vertex_attrib_array(n int) {
|
||||
@ -176,9 +176,9 @@ pub fn enable_vertex_attrib_array(n int) {
|
||||
}
|
||||
|
||||
pub fn gen_buffer() u32 {
|
||||
VBO := u32(0)
|
||||
C.glGenBuffers(1, &VBO)
|
||||
return VBO
|
||||
vbo := u32(0)
|
||||
C.glGenBuffers(1, &vbo)
|
||||
return vbo
|
||||
}
|
||||
|
||||
pub fn vertex_attrib_pointer(index, size int, typ int, normalized bool, stride int, ptr int) {
|
||||
|
Reference in New Issue
Block a user