aboutsummaryrefslogtreecommitdiff
path: root/smelt/glfw
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2018-02-03 00:55:26 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2018-02-03 00:55:26 +0800
commit1eb88d4f5d5cb05d62be1d4a0c88c7399f7c0de0 (patch)
tree4daf8fa3f4e8fff38a61b8e2da752df8b519f232 /smelt/glfw
parent6f955e10a71e364f527ea654156ea83785e9ada8 (diff)
downloadSMELT-1eb88d4f5d5cb05d62be1d4a0c88c7399f7c0de0.tar.xz
Added the GL 3.2+ port.
Fixed poor performance of the truetype renderer. (Partially) Fixed texture locking. Minor addition and fixes to the math library.
Diffstat (limited to 'smelt/glfw')
-rw-r--r--smelt/glfw/gfx_glfw.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/smelt/glfw/gfx_glfw.cpp b/smelt/glfw/gfx_glfw.cpp
index 29841e9..485760d 100644
--- a/smelt/glfw/gfx_glfw.cpp
+++ b/smelt/glfw/gfx_glfw.cpp
@@ -538,11 +538,12 @@ void SMELT_IMPL::smTexutreUnlock(SMTEX tex)
if(!ptex->locpx)return;
if(!ptex->roloc)
{
- DWORD *src=ptex->locpx,*dst=ptex->px+((ptex->locy*ptex->rw)+ptex->locx);
- for(int i=0;i<ptex->loch;++i)//TODO: flip it...
+ DWORD *src=ptex->locpx+ptex->locw*ptex->loch,
+ *dst=ptex->px+(((ptex->rh-ptex->locy-1)*ptex->rw)+ptex->locx);
+ for(int i=0;i<ptex->loch;++i)
{
memcpy(dst,src,ptex->locw*sizeof(DWORD));
- dst+=ptex->rw;src+=ptex->locw;
+ dst-=ptex->rw;src-=ptex->locw;
}
if(ptex->lost)configTexture(ptex,ptex->rw,ptex->rh,ptex->px);
else