custom OpenGL drawing support fixed

This commit is contained in:
Vadim Lopatin 2016-01-13 13:42:54 +03:00
parent d3b2c9bedf
commit 73035e925d
4 changed files with 530 additions and 598 deletions

File diff suppressed because it is too large Load Diff

View File

@ -627,7 +627,7 @@ bool fuzzyNull(float v) {
/// float matrix 4 x 4
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;

View File

@ -761,13 +761,13 @@ public:
override void draw() {
if (_handler) {
glSupport.setOrthoProjection(_windowRect, _rc);
glSupport.clearDepthBuffer();
_handler(_windowRect, _rc);
glSupport.setOrthoProjection(_windowRect, _windowRect);
}
}
}
/// GL Texture object from image
static class GLTexture {
protected int _dx;

View File

@ -860,6 +860,11 @@ class GLSupport {
return _projectionMatrix;
}
/// clear depth buffer
void clearDepthBuffer() {
glClear(GL_DEPTH_BUFFER_BIT);
}
void setOrthoProjection(Rect windowRect, Rect view) {
flushGL();
bufferDx = windowRect.width;