added alpha blending for image and text, nodes position are clamped to be integer

This commit is contained in:
2017-02-08 00:20:26 +00:00
parent 5e5ddf310c
commit de1784e932
4 changed files with 13 additions and 5 deletions

View File

@@ -89,7 +89,8 @@ void App::init()
"in vec2 uv;"
"out vec4 frag;"
"void main(){"
" frag = vec4(texture(tex, uv).r * col.rgb, col.a);"
" float a = texture(tex, uv).r;"
" frag = vec4(col.rgb, a);"
"}";
#ifdef _WIN32
@@ -141,7 +142,10 @@ void App::init()
glDisable(GL_DEPTH_TEST);
glPointSize(5);
glLineWidth(2);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
//int n;
//glGetIntegerv(GL_NUM_EXTENSIONS, &n);
//for (int i = 0; i < n; i++)