mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-23 16:07:52 +00:00
fix GL2
This commit is contained in:
Vendored
+4
-4
@@ -89,8 +89,9 @@ Path :: struct {
|
|||||||
strokeCount: int,
|
strokeCount: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL_UNIFORMARRAY_SIZE :: 11
|
||||||
|
|
||||||
when GL2_IMPLEMENTATION {
|
when GL2_IMPLEMENTATION {
|
||||||
GL_UNIFORMARRAY_SIZE :: 11
|
|
||||||
FragUniforms :: struct #raw_union {
|
FragUniforms :: struct #raw_union {
|
||||||
using _: struct {
|
using _: struct {
|
||||||
scissorMat: [12]f32, // matrices are actually 3 vec4s
|
scissorMat: [12]f32, // matrices are actually 3 vec4s
|
||||||
@@ -415,7 +416,7 @@ __renderCreateTexture :: proc(
|
|||||||
// No mips.
|
// No mips.
|
||||||
if .GENERATE_MIPMAPS in imageFlags {
|
if .GENERATE_MIPMAPS in imageFlags {
|
||||||
log.errorf("Mip-maps is not support for non power-of-two textures (%d x %d)\n", w, h);
|
log.errorf("Mip-maps is not support for non power-of-two textures (%d x %d)\n", w, h);
|
||||||
excl(&imageFlags, nvg.Image_Flag.GENERATE_MIPMAPS)
|
excl(&imageFlags, ImageFlags { .GENERATE_MIPMAPS })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -643,8 +644,7 @@ __renderUpdateTexture :: proc(
|
|||||||
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.RGBA, gl.UNSIGNED_BYTE, raw_data(data))
|
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.RGBA, gl.UNSIGNED_BYTE, raw_data(data))
|
||||||
} else {
|
} else {
|
||||||
when GLES2 || GL2 {
|
when GLES2 || GL2 {
|
||||||
// TODO is missing in odin
|
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.LUMINANCE, gl.UNSIGNED_BYTE, raw_data(data))
|
||||||
// gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.LUMINANCE, gl.UNSIGNED_BYTE, raw_data(data))
|
|
||||||
} else {
|
} else {
|
||||||
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.RED, gl.UNSIGNED_BYTE, raw_data(data))
|
gl.TexSubImage2D(gl.TEXTURE_2D, 0, i32(x), i32(y), i32(w), i32(h), gl.RED, gl.UNSIGNED_BYTE, raw_data(data))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user