FlipY texture flag, display world texture atlas
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
|
||||
#define FLAG_LINEAR (1<<4)
|
||||
#define FLAG_IMGUI_FONT (1<<5)
|
||||
#define FLAG_FLIP_Y (1<<6)
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform int flags;
|
||||
|
@ -1,6 +1,17 @@
|
||||
#version 330
|
||||
|
||||
#define FLAG_RED (1<<0)
|
||||
#define FLAG_GREEN (1<<1)
|
||||
#define FLAG_BLUE (1<<2)
|
||||
#define FLAG_ALPHA (1<<3)
|
||||
#define FLAG_COLORS (FLAG_RED | FLAG_GREEN | FLAG_BLUE | FLAG_ALPHA)
|
||||
|
||||
#define FLAG_LINEAR (1<<4)
|
||||
#define FLAG_IMGUI_FONT (1<<5)
|
||||
#define FLAG_FLIP_Y (1<<6)
|
||||
|
||||
uniform mat4 projection;
|
||||
uniform int flags;
|
||||
|
||||
in vec2 pos;
|
||||
in vec2 uv;
|
||||
@ -13,5 +24,8 @@ void main() {
|
||||
fragUV = uv;
|
||||
fragColor = color;
|
||||
gl_Position = projection * vec4(pos.xy, 0, 1);
|
||||
|
||||
if ((flags & FLAG_FLIP_Y) != 0)
|
||||
fragUV.y = 1 - fragUV.y;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user