.developing DrawGL

git-svn-id: svn://ultimatepp.org/upp/trunk@12649 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-01-07 15:14:11 +00:00
parent 3cf7c8ca48
commit 44eddeca8c
4 changed files with 13 additions and 4 deletions

View file

@ -13,7 +13,7 @@ extern void (*restore_gl_viewport__)();
void GLCtrl::DoGLPaint()
{
glClearDepth(1);
glClearColor(1, 0, 0, 1);
glClearColor(1, 1, 1, 1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
glEnable(GL_MULTISAMPLE);
Size sz = GetSize();

View file

@ -21,7 +21,7 @@ struct GLContext2D { // TODO: This should be changed to regular matrix (later)
void Set(Size sz) { vs = Sizef(2.0 / sz.cx, -2.0 / sz.cy); }
GLContext2D(Size sz) { Set(vs); }
GLContext2D(Size sz) { Set(sz); }
GLContext2D() {}
};

View file

@ -14,6 +14,9 @@ void DrawGL::Init(Size sz, double alpha)
SyncScissor();
prev = Point(0, 0);
path_done = false;
DLOG("DrawGL::Init");
DDUMP(dd.vs);
DDUMP(dd.off);
}
DrawGL::~DrawGL()

View file

@ -24,6 +24,7 @@ void GLTriangles::Draw(const GLContext2D& dd)
void main()
{
gl_FragColor = v_color;
gl_FragColor = vec4(0, 1, 0, 1);
}
)");
@ -35,9 +36,14 @@ void GLTriangles::Draw(const GLContext2D& dd)
va.Add(color, 3);
va.Index(elements);
glEnable(GL_BLEND);
DDUMP(pos);
DDUMP(color);
DDUMP(elements);
// glEnable(GL_BLEND);
glDisable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
// glDepthFunc(GL_LEQUAL);