mirror of https://github.com/buggins/dlangui.git
custom OpenGL drawing support fixed
This commit is contained in:
parent
d3b2c9bedf
commit
73035e925d
File diff suppressed because it is too large
Load Diff
|
@ -627,7 +627,7 @@ bool fuzzyNull(float v) {
|
||||||
|
|
||||||
/// float matrix 4 x 4
|
/// float matrix 4 x 4
|
||||||
struct mat4 {
|
struct mat4 {
|
||||||
float[16] m;
|
float[16] m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
||||||
|
|
||||||
//alias m this;
|
//alias m this;
|
||||||
|
|
||||||
|
|
|
@ -761,13 +761,13 @@ public:
|
||||||
override void draw() {
|
override void draw() {
|
||||||
if (_handler) {
|
if (_handler) {
|
||||||
glSupport.setOrthoProjection(_windowRect, _rc);
|
glSupport.setOrthoProjection(_windowRect, _rc);
|
||||||
|
glSupport.clearDepthBuffer();
|
||||||
_handler(_windowRect, _rc);
|
_handler(_windowRect, _rc);
|
||||||
glSupport.setOrthoProjection(_windowRect, _windowRect);
|
glSupport.setOrthoProjection(_windowRect, _windowRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// GL Texture object from image
|
/// GL Texture object from image
|
||||||
static class GLTexture {
|
static class GLTexture {
|
||||||
protected int _dx;
|
protected int _dx;
|
||||||
|
|
|
@ -860,6 +860,11 @@ class GLSupport {
|
||||||
return _projectionMatrix;
|
return _projectionMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// clear depth buffer
|
||||||
|
void clearDepthBuffer() {
|
||||||
|
glClear(GL_DEPTH_BUFFER_BIT);
|
||||||
|
}
|
||||||
|
|
||||||
void setOrthoProjection(Rect windowRect, Rect view) {
|
void setOrthoProjection(Rect windowRect, Rect view) {
|
||||||
flushGL();
|
flushGL();
|
||||||
bufferDx = windowRect.width;
|
bufferDx = windowRect.width;
|
||||||
|
|
Loading…
Reference in New Issue