diff options
author | chai <chaifix@163.com> | 2018-09-08 18:42:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-08 18:42:22 +0800 |
commit | 8f23f81908e70db749cbbe7e32e862a911c8753d (patch) | |
tree | be19f2748b95cf73064a3e27ce92d3ae9d00c1d1 /src | |
parent | a9f350d1e136ad20e366625fc1f509d045e8cc47 (diff) |
*update
Diffstat (limited to 'src')
-rw-r--r-- | src/libjin/Graphics/Canvas.cpp | 16 | ||||
-rw-r--r-- | src/libjin/Graphics/Drawable.cpp | 10 | ||||
-rw-r--r-- | src/libjin/Input/Event.h | 10 | ||||
-rw-r--r-- | src/libjin/input/event.h | 10 | ||||
-rw-r--r-- | src/lua/modules/event/event.cpp | 5 |
5 files changed, 27 insertions, 24 deletions
diff --git a/src/libjin/Graphics/Canvas.cpp b/src/libjin/Graphics/Canvas.cpp index 1d1a347..4def58d 100644 --- a/src/libjin/Graphics/Canvas.cpp +++ b/src/libjin/Graphics/Canvas.cpp @@ -33,11 +33,11 @@ namespace graphics GLint current_fbo; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); - // generate a new render buffer object + /* generate a new render buffer object */ glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); - // generate texture save target + /* generate texture save target */ glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -48,7 +48,7 @@ namespace graphics GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - // unbind framebuffer + /* unbind framebuffer */ glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); } @@ -79,7 +79,7 @@ namespace graphics glViewport(0, 0, size.w, size.h); glOrtho(0, size.w, size.h, 0, -1, 1); - // Switch back to modelview matrix + /* Switch back to modelview matrix */ glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); @@ -101,15 +101,15 @@ namespace graphics glViewport(0, 0, ww, wh); - // load back to normal + /* load back to normal */ glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - // set viewport matrix + /* set viewport matrix */ glOrtho(0, ww, wh, 0, -1, 1); - // switch to model matrix + /* switch to model matrix */ glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); @@ -118,4 +118,4 @@ namespace graphics } // render } // jin -#endif // LIBJIN_MODULES_RENDER +#endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/Drawable.cpp b/src/libjin/Graphics/Drawable.cpp index acdb6e1..dc1c8dd 100644 --- a/src/libjin/Graphics/Drawable.cpp +++ b/src/libjin/Graphics/Drawable.cpp @@ -30,7 +30,7 @@ namespace graphics void Drawable::draw(int x, int y, float sx, float sy, float r) { - // Must set textCoord and vertCoord before renderring + /* Must set textCoord and vertCoord before renderring */ if (! textCoord||! vertCoord) return; static jin::math::Matrix t; @@ -38,7 +38,7 @@ namespace graphics glBindTexture(GL_TEXTURE_2D, texture); - // push modle matrix + /* push modle matrix */ glPushMatrix(); glMultMatrixf((const GLfloat*)t.getElements()); @@ -50,14 +50,14 @@ namespace graphics glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); - // pop the model matrix + /* pop the model matrix */ glPopMatrix(); - // bind texture to default screen + /* bind texture to default screen */ glBindTexture(GL_TEXTURE_2D, 0); } } // render } // jin -#endif // LIBJIN_MODULES_RENDER +#endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Input/Event.h b/src/libjin/Input/Event.h index 713b393..831c204 100644 --- a/src/libjin/Input/Event.h +++ b/src/libjin/Input/Event.h @@ -58,11 +58,11 @@ namespace input { switch (button) { - case 1: return "left"; - case 2: return "middle"; - case 3: return "right"; - case 4: return "wheelup"; - case 5: return "wheeldown"; + case 1: return "Left"; + case 2: return "Middle"; + case 3: return "Right"; + case 4: return "WheelUp"; + case 5: return "WheelDown"; default: return "?"; } } diff --git a/src/libjin/input/event.h b/src/libjin/input/event.h index 713b393..831c204 100644 --- a/src/libjin/input/event.h +++ b/src/libjin/input/event.h @@ -58,11 +58,11 @@ namespace input { switch (button) { - case 1: return "left"; - case 2: return "middle"; - case 3: return "right"; - case 4: return "wheelup"; - case 5: return "wheeldown"; + case 1: return "Left"; + case 2: return "Middle"; + case 3: return "Right"; + case 4: return "WheelUp"; + case 5: return "WheelDown"; default: return "?"; } } diff --git a/src/lua/modules/event/event.cpp b/src/lua/modules/event/event.cpp index b79e946..08d52e0 100644 --- a/src/lua/modules/event/event.cpp +++ b/src/lua/modules/event/event.cpp @@ -23,7 +23,10 @@ namespace lua poll: while (pollEvent(&e)) { - // each event is a table + /** + * TODO: ڴСıʱҪtransform + * + */ luax_newtable(L); switch (e.type) { |