From fb7ae1149a80a22c77014d0ece33f6f4b965b631 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 31 Mar 2019 14:34:40 +0800 Subject: *misc --- bin/win64/bindingGen.exe | Bin 9728 -> 10240 bytes build/modules/asura-box2d/asura-box2d.vcxproj | 50 ++- .../asura-box2d/asura-box2d.vcxproj.filters | 111 +++-- build/modules/asura-core/asura-core.vcxproj | 29 +- .../modules/asura-core/asura-core.vcxproj.filters | 173 ++++---- build/modules/asura-json/asura-json.vcxproj | 4 +- .../modules/asura-json/asura-json.vcxproj.filters | 13 +- build/modules/asura-network/asura-network.vcxproj | 3 + .../asura-network/asura-network.vcxproj.filters | 11 +- build/modules/asura-openal/asura-openal.vcxproj | 32 +- .../asura-openal/asura-openal.vcxproj.filters | 71 ++- .../modules/asura-plot/asura-plot.vcxproj.filters | 13 +- .../asura-steam/asura-steam.vcxproj.filters | 13 +- build/modules/asura-xml/asura-xml.vcxproj.filters | 8 +- build/tests/07-image/07-image.vcxproj | 1 + build/tests/07-image/07-image.vcxproj.filters | 13 +- build/tools/bindingGen/main.cs | 87 +++- .../DesignTimeResolveAssemblyReferencesInput.cache | Bin 6699 -> 6807 bytes .../Debug/bindingGen.csproj.FileListAbsolute.txt | 7 + build/tools/bindingGen/obj/Debug/bindingGen.exe | Bin 9728 -> 10240 bytes source/3rd-party/Luax/luax_class.hpp | 5 +- source/3rd-party/Luax/luax_state.cpp | 8 +- source/modules/asura-box2d/binding/_body.cpp | 172 -------- source/modules/asura-box2d/binding/_world.cpp | 21 - source/modules/asura-box2d/body.h | 65 --- source/modules/asura-box2d/box2d_module.cpp | 0 source/modules/asura-box2d/box2d_module.h | 19 + source/modules/asura-box2d/chain_shape.h | 0 source/modules/asura-box2d/circle_shape.h | 0 source/modules/asura-box2d/contact.h | 0 source/modules/asura-box2d/debug_draw.h | 0 source/modules/asura-box2d/distance_joint.h | 0 source/modules/asura-box2d/edge_shape.h | 0 source/modules/asura-box2d/fixture.h | 0 source/modules/asura-box2d/friction_joint.h | 0 source/modules/asura-box2d/gear_joint.h | 0 source/modules/asura-box2d/joint.h | 0 source/modules/asura-box2d/motor_joint.h | 0 source/modules/asura-box2d/mouse_joint.h | 0 .../modules/asura-box2d/physics/binding/_body.cpp | 173 ++++++++ .../modules/asura-box2d/physics/binding/_world.cpp | 21 + source/modules/asura-box2d/physics/body.h | 65 +++ source/modules/asura-box2d/physics/chain_shape.h | 0 source/modules/asura-box2d/physics/circle_shape.h | 0 source/modules/asura-box2d/physics/contact.h | 0 source/modules/asura-box2d/physics/debug_draw.h | 9 + .../modules/asura-box2d/physics/distance_joint.h | 0 source/modules/asura-box2d/physics/edge_shape.h | 0 source/modules/asura-box2d/physics/fixture.h | 0 .../modules/asura-box2d/physics/friction_joint.h | 0 source/modules/asura-box2d/physics/gear_joint.h | 0 source/modules/asura-box2d/physics/joint.h | 0 source/modules/asura-box2d/physics/motor_joint.h | 0 source/modules/asura-box2d/physics/mouse_joint.h | 0 source/modules/asura-box2d/physics/polygon_shape.h | 0 .../modules/asura-box2d/physics/prismatic_joint.h | 0 source/modules/asura-box2d/physics/pulley_joint.h | 0 .../modules/asura-box2d/physics/revolute_joint.h | 0 source/modules/asura-box2d/physics/rope_joint.h | 0 source/modules/asura-box2d/physics/shape.h | 0 source/modules/asura-box2d/physics/weld_joint.h | 0 source/modules/asura-box2d/physics/wheel_joint.h | 0 source/modules/asura-box2d/physics/world.h | 19 + source/modules/asura-box2d/polygon_shape.h | 0 source/modules/asura-box2d/prismatic_joint.h | 0 source/modules/asura-box2d/pulley_joint.h | 0 source/modules/asura-box2d/revolute_joint.h | 0 source/modules/asura-box2d/rope_joint.h | 0 source/modules/asura-box2d/shape.h | 0 source/modules/asura-box2d/weld_joint.h | 0 source/modules/asura-box2d/wheel_joint.h | 0 source/modules/asura-box2d/world.h | 19 - source/modules/asura-core/core_config.h | 4 +- source/modules/asura-core/core_module.cpp | 9 +- source/modules/asura-core/core_module.h | 5 + .../modules/asura-core/graphics/binding/_image.cpp | 51 ++- .../asura-core/graphics/binding/_texture.cpp | 86 ++++ .../asura-core/graphics/binding/_window.cpp | 103 ----- source/modules/asura-core/graphics/canvas.cpp | 4 +- source/modules/asura-core/graphics/canvas.h | 2 +- source/modules/asura-core/graphics/color32.cpp | 16 + source/modules/asura-core/graphics/color32.h | 7 + source/modules/asura-core/graphics/image.cpp | 5 +- source/modules/asura-core/graphics/image.h | 10 +- source/modules/asura-core/graphics/shader.cpp | 2 +- source/modules/asura-core/graphics/shader.h | 27 +- source/modules/asura-core/graphics/shader_source.h | 30 ++ source/modules/asura-core/graphics/texture.cpp | 8 +- source/modules/asura-core/graphics/texture.h | 25 +- source/modules/asura-core/input/cursor.defs | 25 -- source/modules/asura-core/input/cursor.h | 25 ++ source/modules/asura-core/input/equeue.cpp | 28 ++ source/modules/asura-core/input/equeue.h | 51 +++ source/modules/asura-core/input/equeue_impl_sdl.h | 0 .../modules/asura-core/input/equeue_impl_win32.h | 0 source/modules/asura-core/input/event_manager.h | 24 + source/modules/asura-core/input/keyboard.defs | 482 --------------------- source/modules/asura-core/input/keyboard.h | 2 +- source/modules/asura-core/input/keys.h | 482 +++++++++++++++++++++ source/modules/asura-core/input/mouse.defs | 7 - source/modules/asura-core/input/mouse.h | 7 + source/modules/asura-core/threading/thread_ex.cpp | 2 +- source/modules/asura-core/window/window.cpp | 50 --- source/modules/asura-core/window/window.h | 90 ---- .../modules/asura-core/window/window_impl_glew.cpp | 0 .../modules/asura-core/window/window_impl_glew.h | 0 .../modules/asura-core/window/window_impl_glut.cpp | 0 .../modules/asura-core/window/window_impl_glut.h | 0 .../modules/asura-core/window/window_impl_sdl.cpp | 0 source/modules/asura-core/window/window_impl_sdl.h | 0 source/modules/asura-core/wnd/binding/_window.cpp | 180 ++++++++ source/modules/asura-core/wnd/window.cpp | 108 +++++ source/modules/asura-core/wnd/window.h | 149 +++++++ source/modules/asura-core/wnd/window_impl_glew.cpp | 0 source/modules/asura-core/wnd/window_impl_glew.h | 0 source/modules/asura-core/wnd/window_impl_glut.cpp | 0 source/modules/asura-core/wnd/window_impl_glut.h | 0 source/modules/asura-core/wnd/window_impl_sdl.cpp | 141 ++++++ source/modules/asura-core/wnd/window_impl_sdl.h | 39 ++ source/modules/asura-json/json.cpp | 0 source/modules/asura-json/json.h | 14 - source/modules/asura-json/json/json.cpp | 0 source/modules/asura-json/json/json.h | 14 + source/modules/asura-network/network_module.h | 0 source/modules/asura-openal/audio.cpp | 0 source/modules/asura-openal/audio.h | 0 source/modules/asura-openal/audio/audio.cpp | 0 source/modules/asura-openal/audio/audio.h | 0 .../modules/asura-openal/audio/mpg123_decoder.cpp | 0 source/modules/asura-openal/audio/mpg123_decoder.h | 0 source/modules/asura-openal/audio/sound.cpp | 0 source/modules/asura-openal/audio/sound.h | 31 ++ source/modules/asura-openal/audio/sound_data.cpp | 0 source/modules/asura-openal/audio/sound_data.h | 0 .../asura-openal/audio/sound_decode_task.cpp | 0 .../modules/asura-openal/audio/sound_decode_task.h | 25 ++ .../modules/asura-openal/audio/sound_decoder.cpp | 29 ++ source/modules/asura-openal/audio/sound_decoder.h | 30 ++ source/modules/asura-openal/audio/source.cpp | 0 source/modules/asura-openal/audio/source.h | 0 .../modules/asura-openal/audio/vorbis_decoder.cpp | 0 source/modules/asura-openal/audio/vorbis_decoder.h | 0 source/modules/asura-openal/mpg123_decoder.cpp | 0 source/modules/asura-openal/mpg123_decoder.h | 0 source/modules/asura-openal/sound.cpp | 0 source/modules/asura-openal/sound.h | 31 -- source/modules/asura-openal/sound_data.cpp | 0 source/modules/asura-openal/sound_data.h | 0 source/modules/asura-openal/sound_decode_task.cpp | 0 source/modules/asura-openal/sound_decode_task.h | 25 -- source/modules/asura-openal/sound_decoder.cpp | 29 -- source/modules/asura-openal/sound_decoder.h | 30 -- source/modules/asura-openal/source.cpp | 0 source/modules/asura-openal/source.h | 0 source/modules/asura-openal/vorbis_decoder.cpp | 0 source/modules/asura-openal/vorbis_decoder.h | 0 .../asura-utils/threading/thread_impl_posix.cpp | 2 + source/modules/asura-utils/type.h | 2 + source/tests/07-image/main.cpp | 0 159 files changed, 2316 insertions(+), 1467 deletions(-) delete mode 100644 source/modules/asura-box2d/binding/_body.cpp delete mode 100644 source/modules/asura-box2d/binding/_world.cpp delete mode 100644 source/modules/asura-box2d/body.h create mode 100644 source/modules/asura-box2d/box2d_module.cpp create mode 100644 source/modules/asura-box2d/box2d_module.h delete mode 100644 source/modules/asura-box2d/chain_shape.h delete mode 100644 source/modules/asura-box2d/circle_shape.h delete mode 100644 source/modules/asura-box2d/contact.h delete mode 100644 source/modules/asura-box2d/debug_draw.h delete mode 100644 source/modules/asura-box2d/distance_joint.h delete mode 100644 source/modules/asura-box2d/edge_shape.h delete mode 100644 source/modules/asura-box2d/fixture.h delete mode 100644 source/modules/asura-box2d/friction_joint.h delete mode 100644 source/modules/asura-box2d/gear_joint.h delete mode 100644 source/modules/asura-box2d/joint.h delete mode 100644 source/modules/asura-box2d/motor_joint.h delete mode 100644 source/modules/asura-box2d/mouse_joint.h create mode 100644 source/modules/asura-box2d/physics/binding/_body.cpp create mode 100644 source/modules/asura-box2d/physics/binding/_world.cpp create mode 100644 source/modules/asura-box2d/physics/body.h create mode 100644 source/modules/asura-box2d/physics/chain_shape.h create mode 100644 source/modules/asura-box2d/physics/circle_shape.h create mode 100644 source/modules/asura-box2d/physics/contact.h create mode 100644 source/modules/asura-box2d/physics/debug_draw.h create mode 100644 source/modules/asura-box2d/physics/distance_joint.h create mode 100644 source/modules/asura-box2d/physics/edge_shape.h create mode 100644 source/modules/asura-box2d/physics/fixture.h create mode 100644 source/modules/asura-box2d/physics/friction_joint.h create mode 100644 source/modules/asura-box2d/physics/gear_joint.h create mode 100644 source/modules/asura-box2d/physics/joint.h create mode 100644 source/modules/asura-box2d/physics/motor_joint.h create mode 100644 source/modules/asura-box2d/physics/mouse_joint.h create mode 100644 source/modules/asura-box2d/physics/polygon_shape.h create mode 100644 source/modules/asura-box2d/physics/prismatic_joint.h create mode 100644 source/modules/asura-box2d/physics/pulley_joint.h create mode 100644 source/modules/asura-box2d/physics/revolute_joint.h create mode 100644 source/modules/asura-box2d/physics/rope_joint.h create mode 100644 source/modules/asura-box2d/physics/shape.h create mode 100644 source/modules/asura-box2d/physics/weld_joint.h create mode 100644 source/modules/asura-box2d/physics/wheel_joint.h create mode 100644 source/modules/asura-box2d/physics/world.h delete mode 100644 source/modules/asura-box2d/polygon_shape.h delete mode 100644 source/modules/asura-box2d/prismatic_joint.h delete mode 100644 source/modules/asura-box2d/pulley_joint.h delete mode 100644 source/modules/asura-box2d/revolute_joint.h delete mode 100644 source/modules/asura-box2d/rope_joint.h delete mode 100644 source/modules/asura-box2d/shape.h delete mode 100644 source/modules/asura-box2d/weld_joint.h delete mode 100644 source/modules/asura-box2d/wheel_joint.h delete mode 100644 source/modules/asura-box2d/world.h create mode 100644 source/modules/asura-core/graphics/binding/_texture.cpp delete mode 100644 source/modules/asura-core/graphics/binding/_window.cpp create mode 100644 source/modules/asura-core/graphics/shader_source.h delete mode 100644 source/modules/asura-core/input/cursor.defs create mode 100644 source/modules/asura-core/input/equeue.cpp create mode 100644 source/modules/asura-core/input/equeue.h create mode 100644 source/modules/asura-core/input/equeue_impl_sdl.h create mode 100644 source/modules/asura-core/input/equeue_impl_win32.h create mode 100644 source/modules/asura-core/input/event_manager.h delete mode 100644 source/modules/asura-core/input/keyboard.defs create mode 100644 source/modules/asura-core/input/keys.h delete mode 100644 source/modules/asura-core/input/mouse.defs delete mode 100644 source/modules/asura-core/window/window.cpp delete mode 100644 source/modules/asura-core/window/window.h delete mode 100644 source/modules/asura-core/window/window_impl_glew.cpp delete mode 100644 source/modules/asura-core/window/window_impl_glew.h delete mode 100644 source/modules/asura-core/window/window_impl_glut.cpp delete mode 100644 source/modules/asura-core/window/window_impl_glut.h delete mode 100644 source/modules/asura-core/window/window_impl_sdl.cpp delete mode 100644 source/modules/asura-core/window/window_impl_sdl.h create mode 100644 source/modules/asura-core/wnd/binding/_window.cpp create mode 100644 source/modules/asura-core/wnd/window.cpp create mode 100644 source/modules/asura-core/wnd/window.h create mode 100644 source/modules/asura-core/wnd/window_impl_glew.cpp create mode 100644 source/modules/asura-core/wnd/window_impl_glew.h create mode 100644 source/modules/asura-core/wnd/window_impl_glut.cpp create mode 100644 source/modules/asura-core/wnd/window_impl_glut.h create mode 100644 source/modules/asura-core/wnd/window_impl_sdl.cpp create mode 100644 source/modules/asura-core/wnd/window_impl_sdl.h delete mode 100644 source/modules/asura-json/json.cpp delete mode 100644 source/modules/asura-json/json.h create mode 100644 source/modules/asura-json/json/json.cpp create mode 100644 source/modules/asura-json/json/json.h create mode 100644 source/modules/asura-network/network_module.h delete mode 100644 source/modules/asura-openal/audio.cpp delete mode 100644 source/modules/asura-openal/audio.h create mode 100644 source/modules/asura-openal/audio/audio.cpp create mode 100644 source/modules/asura-openal/audio/audio.h create mode 100644 source/modules/asura-openal/audio/mpg123_decoder.cpp create mode 100644 source/modules/asura-openal/audio/mpg123_decoder.h create mode 100644 source/modules/asura-openal/audio/sound.cpp create mode 100644 source/modules/asura-openal/audio/sound.h create mode 100644 source/modules/asura-openal/audio/sound_data.cpp create mode 100644 source/modules/asura-openal/audio/sound_data.h create mode 100644 source/modules/asura-openal/audio/sound_decode_task.cpp create mode 100644 source/modules/asura-openal/audio/sound_decode_task.h create mode 100644 source/modules/asura-openal/audio/sound_decoder.cpp create mode 100644 source/modules/asura-openal/audio/sound_decoder.h create mode 100644 source/modules/asura-openal/audio/source.cpp create mode 100644 source/modules/asura-openal/audio/source.h create mode 100644 source/modules/asura-openal/audio/vorbis_decoder.cpp create mode 100644 source/modules/asura-openal/audio/vorbis_decoder.h delete mode 100644 source/modules/asura-openal/mpg123_decoder.cpp delete mode 100644 source/modules/asura-openal/mpg123_decoder.h delete mode 100644 source/modules/asura-openal/sound.cpp delete mode 100644 source/modules/asura-openal/sound.h delete mode 100644 source/modules/asura-openal/sound_data.cpp delete mode 100644 source/modules/asura-openal/sound_data.h delete mode 100644 source/modules/asura-openal/sound_decode_task.cpp delete mode 100644 source/modules/asura-openal/sound_decode_task.h delete mode 100644 source/modules/asura-openal/sound_decoder.cpp delete mode 100644 source/modules/asura-openal/sound_decoder.h delete mode 100644 source/modules/asura-openal/source.cpp delete mode 100644 source/modules/asura-openal/source.h delete mode 100644 source/modules/asura-openal/vorbis_decoder.cpp delete mode 100644 source/modules/asura-openal/vorbis_decoder.h create mode 100644 source/tests/07-image/main.cpp diff --git a/bin/win64/bindingGen.exe b/bin/win64/bindingGen.exe index b196836..016c299 100644 Binary files a/bin/win64/bindingGen.exe and b/bin/win64/bindingGen.exe differ diff --git a/build/modules/asura-box2d/asura-box2d.vcxproj b/build/modules/asura-box2d/asura-box2d.vcxproj index 9855a26..61c03c5 100644 --- a/build/modules/asura-box2d/asura-box2d.vcxproj +++ b/build/modules/asura-box2d/asura-box2d.vcxproj @@ -117,32 +117,34 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + + + diff --git a/build/modules/asura-box2d/asura-box2d.vcxproj.filters b/build/modules/asura-box2d/asura-box2d.vcxproj.filters index 4411d16..a7a33eb 100644 --- a/build/modules/asura-box2d/asura-box2d.vcxproj.filters +++ b/build/modules/asura-box2d/asura-box2d.vcxproj.filters @@ -1,40 +1,89 @@  - - - - - - - - - - - - - - - - - - - - - - + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + + + physics + - - binding - - - binding - + + {c01b5c57-f3a7-445f-aed3-e0a27dbe74c2} + + + {3fb6587c-0c9d-4f6e-9e72-653032d9b238} + - - {a446fe08-e138-456d-bbc0-4e8d4aa79989} - + + + physics\binding + + + physics\binding + \ No newline at end of file diff --git a/build/modules/asura-core/asura-core.vcxproj b/build/modules/asura-core/asura-core.vcxproj index 1ad07c2..e539e72 100644 --- a/build/modules/asura-core/asura-core.vcxproj +++ b/build/modules/asura-core/asura-core.vcxproj @@ -131,7 +131,7 @@ - + @@ -153,16 +153,18 @@ + - - - - + + + + + @@ -190,6 +192,7 @@ + @@ -197,27 +200,29 @@ + + + + - - - - + + + + - - - + diff --git a/build/modules/asura-core/asura-core.vcxproj.filters b/build/modules/asura-core/asura-core.vcxproj.filters index 84a379f..eb4b20c 100644 --- a/build/modules/asura-core/asura-core.vcxproj.filters +++ b/build/modules/asura-core/asura-core.vcxproj.filters @@ -19,12 +19,18 @@ {4f6b2c19-1a06-48c9-b89d-52fa27bec5c1} - - {7a73607c-8da6-4865-a992-5c7c8764bd5a} - {05477a0e-f70b-4606-ae96-82ef7a7b8a1d} + + {7a73607c-8da6-4865-a992-5c7c8764bd5a} + + + {139aa01b-d038-4361-9edd-f81d8ba37730} + + + {66e43743-1be3-414a-9f3c-473d40613892} + @@ -70,18 +76,6 @@ graphics - - input - - - input - - - input - - - input - font @@ -101,9 +95,6 @@ graphics - - input - graphics\binding @@ -131,21 +122,6 @@ graphics\binding - - graphics\binding - - - window - - - window - - - window - - - window - threading @@ -161,6 +137,42 @@ graphics + + wnd + + + wnd + + + wnd + + + wnd + + + graphics\binding + + + wnd\binding + + + input + + + input + + + input + + + input + + + input + + + input + @@ -215,21 +227,6 @@ graphics - - input - - - input - - - input - - - input - - - input - font @@ -251,30 +248,9 @@ - - input - - - input - graphics - - input - - - window - - - window - - - window - - - window - threading @@ -293,6 +269,57 @@ graphics + + wnd + + + wnd + + + wnd + + + wnd + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + input + + + graphics + @@ -301,13 +328,7 @@ font - - input - - - input - - + input diff --git a/build/modules/asura-json/asura-json.vcxproj b/build/modules/asura-json/asura-json.vcxproj index 755ca25..d4a2521 100644 --- a/build/modules/asura-json/asura-json.vcxproj +++ b/build/modules/asura-json/asura-json.vcxproj @@ -117,11 +117,11 @@ - + - + diff --git a/build/modules/asura-json/asura-json.vcxproj.filters b/build/modules/asura-json/asura-json.vcxproj.filters index 988e477..97944e6 100644 --- a/build/modules/asura-json/asura-json.vcxproj.filters +++ b/build/modules/asura-json/asura-json.vcxproj.filters @@ -1,11 +1,20 @@  - + + json + - + + json + + + + + {2884af6d-6bc5-4714-8b32-32edd8099000} + \ No newline at end of file diff --git a/build/modules/asura-network/asura-network.vcxproj b/build/modules/asura-network/asura-network.vcxproj index 957bce0..0ed3418 100644 --- a/build/modules/asura-network/asura-network.vcxproj +++ b/build/modules/asura-network/asura-network.vcxproj @@ -18,6 +18,9 @@ x64 + + + 15.0 {6361701E-BD43-4AE9-8AE2-5C8F87D436BA} diff --git a/build/modules/asura-network/asura-network.vcxproj.filters b/build/modules/asura-network/asura-network.vcxproj.filters index 9cd8510..a475832 100644 --- a/build/modules/asura-network/asura-network.vcxproj.filters +++ b/build/modules/asura-network/asura-network.vcxproj.filters @@ -1,2 +1,11 @@  - \ No newline at end of file + + + + {c48e682b-c747-4a26-aabc-98e5d05c179c} + + + + + + \ No newline at end of file diff --git a/build/modules/asura-openal/asura-openal.vcxproj b/build/modules/asura-openal/asura-openal.vcxproj index 04827fa..3649648 100644 --- a/build/modules/asura-openal/asura-openal.vcxproj +++ b/build/modules/asura-openal/asura-openal.vcxproj @@ -117,24 +117,24 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/build/modules/asura-openal/asura-openal.vcxproj.filters b/build/modules/asura-openal/asura-openal.vcxproj.filters index ceb2b29..4a7af79 100644 --- a/build/modules/asura-openal/asura-openal.vcxproj.filters +++ b/build/modules/asura-openal/asura-openal.vcxproj.filters @@ -1,28 +1,63 @@  - - - - - - - - + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + - - - - - - - - + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + + + audio + - - {006a5466-b1f4-4ab3-9f6c-eae54a78df37} + + {35f52c38-26da-43eb-9ca2-8c5d32f38b37} + + + {dbd7324a-d1b4-4370-ba8d-df87b31d984c} \ No newline at end of file diff --git a/build/modules/asura-plot/asura-plot.vcxproj.filters b/build/modules/asura-plot/asura-plot.vcxproj.filters index 3c6f4fd..13e717f 100644 --- a/build/modules/asura-plot/asura-plot.vcxproj.filters +++ b/build/modules/asura-plot/asura-plot.vcxproj.filters @@ -1,17 +1,8 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {0f829a34-bb64-4d78-b97a-32c6679fc43b} \ No newline at end of file diff --git a/build/modules/asura-steam/asura-steam.vcxproj.filters b/build/modules/asura-steam/asura-steam.vcxproj.filters index 3c6f4fd..d48ea8c 100644 --- a/build/modules/asura-steam/asura-steam.vcxproj.filters +++ b/build/modules/asura-steam/asura-steam.vcxproj.filters @@ -1,17 +1,8 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {73580bc7-0dec-4284-a31a-9a84f284326a} \ No newline at end of file diff --git a/build/modules/asura-xml/asura-xml.vcxproj.filters b/build/modules/asura-xml/asura-xml.vcxproj.filters index 9cd8510..d4c889c 100644 --- a/build/modules/asura-xml/asura-xml.vcxproj.filters +++ b/build/modules/asura-xml/asura-xml.vcxproj.filters @@ -1,2 +1,8 @@  - \ No newline at end of file + + + + {d8671556-9eb0-4627-a264-e7b667109bc4} + + + \ No newline at end of file diff --git a/build/tests/07-image/07-image.vcxproj b/build/tests/07-image/07-image.vcxproj index 11012d8..be7d160 100644 --- a/build/tests/07-image/07-image.vcxproj +++ b/build/tests/07-image/07-image.vcxproj @@ -115,6 +115,7 @@ + diff --git a/build/tests/07-image/07-image.vcxproj.filters b/build/tests/07-image/07-image.vcxproj.filters index 3c6f4fd..77b23f4 100644 --- a/build/tests/07-image/07-image.vcxproj.filters +++ b/build/tests/07-image/07-image.vcxproj.filters @@ -1,17 +1,6 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - + \ No newline at end of file diff --git a/build/tools/bindingGen/main.cs b/build/tools/bindingGen/main.cs index 7f99da4..f58b846 100644 --- a/build/tools/bindingGen/main.cs +++ b/build/tools/bindingGen/main.cs @@ -20,6 +20,7 @@ namespace bindingGen static string output = @"#include ""../{0}.h"" using namespace std; +using namespace Luax; namespace {1} {{ @@ -78,14 +79,14 @@ namespace {1} return ""; string register_methods = ""; register_methods += "\t\t\tLUAX_REGISTER_METHODS(state,\n"; - int maxlen = 0; - foreach(var m in methods) + int maxlen = 0; + foreach (var m in methods) { string method = m.ToString(); if (method.Count() > maxlen) - maxlen = method.Count(); + maxlen = method.Count(); } - for(int i = 0; i < methods.Count; ++i) + for (int i = 0; i < methods.Count; ++i) { Match m = methods[i]; string method = m.ToString(); @@ -107,12 +108,12 @@ namespace {1} if (mc.Count == 0) return ""; - string methods = ""; + string methods = ""; - foreach(var m in mc) + foreach (var m in mc) { string name = m.ToString(); - if(name != "_New") + if (name != "_New") { methods += String.Format(method, cname, name.Substring(1, name.Count() - 1), cname.ToLower()); } @@ -125,16 +126,36 @@ namespace {1} return methods; } + static int IndexOfChar(string str, char c, int n) + { + int j = 0; + for (int i = 0; i < str.Count(); ++i) + { + char ch = str[i]; + if (ch == c) + { + if (j == n) + return i; + ++j; + } + } + return -1; + } + static string make_register_enum(MatchCollection mc, string src) { if (mc.Count == 0) return ""; string reg_enum_l = @"(?<=enum\s*"; - string reg_enum_r = @"[\s\n]*\{((?!\})[\s\S])*)[A-Z_]+(?=\s*)"; + string reg_enum_r = @"[\s\n]*\{((?!\})[\s\S])*\s)[A-Z_0-9]+(?=[\s\=,]+)"; string enums = ""; - foreach(var m in mc) + // 尝试查找下划线索引号,如果没有,代表这个枚举字符串全部都是key + string reg_under_line_l = @"(?<=LUAX_DECL_ENUM\s*\(\s*"; + string reg_under_line_r = @"\s*,\s*)[0-9]+(?=\s*\))"; + + foreach (var m in mc) { string name = m.ToString(); enums += "\t\t\tLUAX_REGISTER_ENUM(state, "; @@ -142,15 +163,30 @@ namespace {1} MatchCollection values = Regex.Matches(src, reg_enum_l + name + reg_enum_r); string[] enames = new string[values.Count]; string[] keys = new string[values.Count]; + int underline_index = -1; + Match underline = Regex.Match(src, reg_under_line_l + name + reg_under_line_r); + if (underline.Success) + { + underline_index = int.Parse(underline.ToString()); + } int maxEname = 0, maxKey = 0; for (int i = 0; i < values.Count; ++i) { - enames[i] = values[i].ToString(); - keys[i] = enames[i].Substring(enames[i].LastIndexOf('_') + 1, enames[i].Count() - enames[i].LastIndexOf('_') -1); + enames[i] = values[i].ToString(); + if(underline_index != -1) + { + int start = IndexOfChar(enames[i], '_', underline_index) + 1; + keys[i] = enames[i].Substring(start, enames[i].Count() - start); + } + else + { + // 表明全部都是key + keys[i] = enames[i]; + } if (enames[i].Count() > maxEname) maxEname = enames[i].Count(); if (keys[i].Count() > maxKey) maxKey = keys[i].Count(); } - for(int i = 0; i < values.Count; ++i) + for (int i = 0; i < values.Count; ++i) { enums += "\t\t\t\t{ "; enums += ('"' + keys[i] + "\",").PadRight(maxKey + 4); @@ -183,17 +219,18 @@ namespace {1} return; string reg_class = @"(?<=Portable\<)[0-9a-zA-Z]+(?=\>)"; + string reg_abclass = @"(?<=LUAX_DECL_ABSTRACT_FACTORY\s*\(\s*)[0-9a-zA-Z]+(?=\s*\))"; string reg_methods = @"(?<=LUAX_DECL_METHOD\()[0-9a-zA-Z_]+(?=\))"; - string reg_enums = @"(?<=LUAX_DECL_ENUM\()[0-9a-zA-Z_]+(?=\))"; + string reg_enums = @"(?<=LUAX_DECL_ENUM\()[0-9a-zA-Z_]+(?=\s*[\),]+)"; string reg_namespace = @"(?<=namespace\s)[0-9a-zA-Z]+(?=[\s\n]*\{)"; - if(!Directory.Exists(dir + "/binding")) + if (!Directory.Exists(dir + "/binding")) { Directory.CreateDirectory(dir + "/binding"); } string[] files = Directory.GetFiles(dir); - for(int i = 0; i < files.Count(); ++i) + for (int i = 0; i < files.Count(); ++i) { string file = files[i]; if (!File.Exists(file)) @@ -204,14 +241,24 @@ namespace {1} if (File.Exists(bindingFile)) continue; string code = File.ReadAllText(file); - // + // 工厂和单例 Match m = Regex.Match(code, reg_class); + string className = ""; + if (m.Success) + { + className = m.ToString(); + } if (!m.Success) - continue; - string className = m.ToString(); + { + // 抽象类,不会继承Portable模板 + Match abstract_m = Regex.Match(code, reg_abclass); + if (!abstract_m.Success) + continue; + className = abstract_m.ToString(); + } MatchCollection mc = Regex.Matches(code, reg_namespace); // 应该两个名称空间 - if(mc.Count != 2) + if (mc.Count != 2) { Console.WriteLine("Error: 源文件没有两个名称空间 " + file); continue; @@ -227,7 +274,7 @@ namespace {1} mc = Regex.Matches(code, reg_methods); content += make_impl_methods(mc, className); string binding = String.Format(output, name, namespace1, namespace2, content); - Console.WriteLine("输出: "+bindingFile); + Console.WriteLine("输出: " + bindingFile); File.WriteAllText(bindingFile, binding); } } diff --git a/build/tools/bindingGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/build/tools/bindingGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index b89f8dd..78a75d8 100644 Binary files a/build/tools/bindingGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/build/tools/bindingGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/build/tools/bindingGen/obj/Debug/bindingGen.csproj.FileListAbsolute.txt b/build/tools/bindingGen/obj/Debug/bindingGen.csproj.FileListAbsolute.txt index 3656c65..091c0f8 100644 --- a/build/tools/bindingGen/obj/Debug/bindingGen.csproj.FileListAbsolute.txt +++ b/build/tools/bindingGen/obj/Debug/bindingGen.csproj.FileListAbsolute.txt @@ -8,3 +8,10 @@ D:\Asura\build\tools\bindingGen\obj\Debug\bindingGen.pdb D:\Asura\bin\win64\bindingGen.exe.config D:\Asura\bin\win64\bindingGen.exe D:\Asura\bin\win64\bindingGen.pdb +D:\Documents\VisualStudio2017\Projects\Asura\bin\win64\bindingGen.exe.config +D:\Documents\VisualStudio2017\Projects\Asura\bin\win64\bindingGen.exe +D:\Documents\VisualStudio2017\Projects\Asura\bin\win64\bindingGen.pdb +D:\Documents\VisualStudio2017\Projects\Asura\Build\tools\bindingGen\obj\Debug\bindingGen.csprojAssemblyReference.cache +D:\Documents\VisualStudio2017\Projects\Asura\Build\tools\bindingGen\obj\Debug\bindingGen.csproj.CoreCompileInputs.cache +D:\Documents\VisualStudio2017\Projects\Asura\Build\tools\bindingGen\obj\Debug\bindingGen.exe +D:\Documents\VisualStudio2017\Projects\Asura\Build\tools\bindingGen\obj\Debug\bindingGen.pdb diff --git a/build/tools/bindingGen/obj/Debug/bindingGen.exe b/build/tools/bindingGen/obj/Debug/bindingGen.exe index b196836..016c299 100644 Binary files a/build/tools/bindingGen/obj/Debug/bindingGen.exe and b/build/tools/bindingGen/obj/Debug/bindingGen.exe differ diff --git a/source/3rd-party/Luax/luax_class.hpp b/source/3rd-party/Luax/luax_class.hpp index 08b4e3f..e056b75 100644 --- a/source/3rd-party/Luax/luax_class.hpp +++ b/source/3rd-party/Luax/luax_class.hpp @@ -44,7 +44,7 @@ namespace Luax #define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L) -#define LUAX_DECL_ENUM(e) +#define LUAX_DECL_ENUM(e, under_line_index) static void _luax_decl_enum_##e() /// /// ʵֵĺꡣһL @@ -62,6 +62,7 @@ namespace Luax /// #define LUAX_REGISTER_FACTORY(state, type) state.RegisterFactory() #define LUAX_REGISTER_SINGLETON(state, type) state.RegisterSingleton() +#define LUAX_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterLuaxPostprocess(state) #define LUAX_REGISTER_METHODS(state, ...) \ do{ \ luaL_Reg __m[] = {__VA_ARGS__,{0, 0}}; \ @@ -77,6 +78,8 @@ namespace Luax LUAX_STATE(L); \ T* self = state.GetUserdata(1); +#define LUAX_INHERIT(state, type) type::RegisterLuaxClass(state) + /// /// ࣬Ϊʵֶ̬ҪЩӿڵⲿҪ̳д֮࣬оͻ /// öӦʵķע̳дʱʵķʵLuaxNativeClassУʵֻ diff --git a/source/3rd-party/Luax/luax_state.cpp b/source/3rd-party/Luax/luax_state.cpp index 3eae1df..612f26e 100644 --- a/source/3rd-party/Luax/luax_state.cpp +++ b/source/3rd-party/Luax/luax_state.cpp @@ -314,7 +314,7 @@ namespace Luax lua_gettable(mState, idx); } - std::string LuaxState::GetField(int idx, cc8* key, cc8* value) + std::string LuaxState::GetField(int idx, cc8* key, cc8* default_value) { std::string str; if (this->GetFieldWithType(idx, key, LUA_TSTRING)) { @@ -322,12 +322,12 @@ namespace Luax lua_pop(mState, 1); } else { - str = value; + str = default_value; } return str; } - std::string LuaxState::GetField(int idx, int key, cc8* value) + std::string LuaxState::GetField(int idx, int key, cc8* default_value) { std::string str; if (this->GetFieldWithType(idx, key, LUA_TSTRING)) { @@ -335,7 +335,7 @@ namespace Luax lua_pop(mState, 1); } else { - str = value; + str = default_value; } return str; } diff --git a/source/modules/asura-box2d/binding/_body.cpp b/source/modules/asura-box2d/binding/_body.cpp deleted file mode 100644 index 51cc0ab..0000000 --- a/source/modules/asura-box2d/binding/_body.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "../body.h" - -using namespace std; - -namespace AsuraEngine -{ - namespace Physics - { - - LUAX_REGISTRY(Body) - { - LUAX_REGISTER_METHODS(state, - { "GetType", _GetType }, - { "GetX", _GetX }, - { "GetY", _GetY }, - { "GetAngle", _GetAngle }, - { "GetPosition", _GetPosition }, - { "GetLinearVelocity", _GetLinearVelocity }, - { "GetWorldCenter", _GetWorldCenter }, - { "GetLocalCenter", _GetLocalCenter }, - { "GetAngularVelocity", _GetAngularVelocity }, - { "GetMass", _GetMass }, - { "GetInertia", _GetInertia }, - { "GetMassData", _GetMassData }, - { "GetAngularDamping", _GetAngularDamping }, - { "GetLinearDamping", _GetLinearDamping }, - { "GetGravityScale", _GetGravityScale }, - { "GetGravityScale", _GetGravityScale } - ); - } - - LUAX_POSTPROCESS(Body) - { - LUAX_REGISTER_ENUM(state, "EBodyType", - { "INVALID", BODY_TYPE_INVALID }, - { "STATIC", BODY_TYPE_STATIC }, - { "DYNAMIC", BODY_TYPE_DYNAMIC }, - { "KINEMATIC", BODY_TYPE_KINEMATIC }, - { "ENUM", BODY_TYPE_MAX_ENUM } - ); - - } - - // body:GetType() - LUAX_IMPL_METHOD(Body, _GetType) - { - LUAX_PREPARE(L, Body); - return 0; - } - - // body:GetX() - LUAX_IMPL_METHOD(Body, _GetX) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetY() - LUAX_IMPL_METHOD(Body, _GetY) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetAngle() - LUAX_IMPL_METHOD(Body, _GetAngle) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetPosition() - LUAX_IMPL_METHOD(Body, _GetPosition) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetLinearVelocity() - LUAX_IMPL_METHOD(Body, _GetLinearVelocity) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetWorldCenter() - LUAX_IMPL_METHOD(Body, _GetWorldCenter) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetLocalCenter() - LUAX_IMPL_METHOD(Body, _GetLocalCenter) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetAngularVelocity() - LUAX_IMPL_METHOD(Body, _GetAngularVelocity) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetMass() - LUAX_IMPL_METHOD(Body, _GetMass) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetInertia() - LUAX_IMPL_METHOD(Body, _GetInertia) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetMassData() - LUAX_IMPL_METHOD(Body, _GetMassData) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetAngularDamping() - LUAX_IMPL_METHOD(Body, _GetAngularDamping) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetLinearDamping() - LUAX_IMPL_METHOD(Body, _GetLinearDamping) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetGravityScale() - LUAX_IMPL_METHOD(Body, _GetGravityScale) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - // body:GetGravityScale() - LUAX_IMPL_METHOD(Body, _GetGravityScale) - { - LUAX_PREPARE(L, Body); - - return 0; - } - - } -} diff --git a/source/modules/asura-box2d/binding/_world.cpp b/source/modules/asura-box2d/binding/_world.cpp deleted file mode 100644 index 6edd193..0000000 --- a/source/modules/asura-box2d/binding/_world.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "../world.h" - -using namespace std; - -namespace AsuraEngine -{ - namespace Physics - { - - LUAX_REGISTRY(World) - { - - } - - LUAX_POSTPROCESS(World) - { - - } - - } -} diff --git a/source/modules/asura-box2d/body.h b/source/modules/asura-box2d/body.h deleted file mode 100644 index 57295c6..0000000 --- a/source/modules/asura-box2d/body.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __ASURA_BOX2D_BODY_H__ -#define __ASURA_BOX2D_BODY_H__ - -#include - -#include - -namespace AsuraEngine -{ - namespace Physics - { - - class World; - - enum BodyType - { - BODY_TYPE_INVALID, - BODY_TYPE_STATIC, - BODY_TYPE_DYNAMIC, - BODY_TYPE_KINEMATIC, - BODY_TYPE_MAX_ENUM - }; - - class Body - : public AEScripting::Portable - { - public: - - LUAX_DECL_FACTORY(Body); - - b2Body *body; - - private: - - //----------------------------------------------------------------------------// - - LUAX_DECL_ENUM(BodyType); - - LUAX_DECL_METHOD(_GetType); - LUAX_DECL_METHOD(_GetX); - LUAX_DECL_METHOD(_GetY); - LUAX_DECL_METHOD(_GetAngle); - LUAX_DECL_METHOD(_GetPosition); - LUAX_DECL_METHOD(_GetLinearVelocity); - LUAX_DECL_METHOD(_GetWorldCenter); - LUAX_DECL_METHOD(_GetLocalCenter); - LUAX_DECL_METHOD(_GetAngularVelocity); - LUAX_DECL_METHOD(_GetMass); - LUAX_DECL_METHOD(_GetInertia); - LUAX_DECL_METHOD(_GetMassData); - LUAX_DECL_METHOD(_GetAngularDamping); - LUAX_DECL_METHOD(_GetLinearDamping); - LUAX_DECL_METHOD(_GetGravityScale); - LUAX_DECL_METHOD(_GetGravityScale); - - //----------------------------------------------------------------------------// - - World* mWorld; - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-box2d/box2d_module.cpp b/source/modules/asura-box2d/box2d_module.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/box2d_module.h b/source/modules/asura-box2d/box2d_module.h new file mode 100644 index 0000000..052078a --- /dev/null +++ b/source/modules/asura-box2d/box2d_module.h @@ -0,0 +1,19 @@ +#ifndef __ASURA_BOX2D_MODULE_H__ +#define __ASURA_BOX2D_MODULE_H__ + +#include + +namespace AsuraEngine +{ + + class Box2DModule ASURA_FINAL : public Module + { + public: + + + + }; + +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-box2d/chain_shape.h b/source/modules/asura-box2d/chain_shape.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/circle_shape.h b/source/modules/asura-box2d/circle_shape.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/contact.h b/source/modules/asura-box2d/contact.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/debug_draw.h b/source/modules/asura-box2d/debug_draw.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/distance_joint.h b/source/modules/asura-box2d/distance_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/edge_shape.h b/source/modules/asura-box2d/edge_shape.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/fixture.h b/source/modules/asura-box2d/fixture.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/friction_joint.h b/source/modules/asura-box2d/friction_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/gear_joint.h b/source/modules/asura-box2d/gear_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/joint.h b/source/modules/asura-box2d/joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/motor_joint.h b/source/modules/asura-box2d/motor_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/mouse_joint.h b/source/modules/asura-box2d/mouse_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/physics/binding/_body.cpp b/source/modules/asura-box2d/physics/binding/_body.cpp new file mode 100644 index 0000000..68f3aaf --- /dev/null +++ b/source/modules/asura-box2d/physics/binding/_body.cpp @@ -0,0 +1,173 @@ +#include "../body.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(Body) + { + LUAX_REGISTER_METHODS(state, + { "GetType", _GetType }, + { "GetX", _GetX }, + { "GetY", _GetY }, + { "GetAngle", _GetAngle }, + { "GetPosition", _GetPosition }, + { "GetLinearVelocity", _GetLinearVelocity }, + { "GetWorldCenter", _GetWorldCenter }, + { "GetLocalCenter", _GetLocalCenter }, + { "GetAngularVelocity", _GetAngularVelocity }, + { "GetMass", _GetMass }, + { "GetInertia", _GetInertia }, + { "GetMassData", _GetMassData }, + { "GetAngularDamping", _GetAngularDamping }, + { "GetLinearDamping", _GetLinearDamping }, + { "GetGravityScale", _GetGravityScale }, + { "GetGravityScale", _GetGravityScale } + ); + } + + LUAX_POSTPROCESS(Body) + { + LUAX_REGISTER_ENUM(state, "EBodyType", + { "INVALID", BODY_TYPE_INVALID }, + { "STATIC", BODY_TYPE_STATIC }, + { "DYNAMIC", BODY_TYPE_DYNAMIC }, + { "KINEMATIC", BODY_TYPE_KINEMATIC }, + { "ENUM", BODY_TYPE_MAX_ENUM } + ); + + } + + // body:GetType() + LUAX_IMPL_METHOD(Body, _GetType) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetX() + LUAX_IMPL_METHOD(Body, _GetX) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetY() + LUAX_IMPL_METHOD(Body, _GetY) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngle() + LUAX_IMPL_METHOD(Body, _GetAngle) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetPosition() + LUAX_IMPL_METHOD(Body, _GetPosition) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearVelocity() + LUAX_IMPL_METHOD(Body, _GetLinearVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetWorldCenter() + LUAX_IMPL_METHOD(Body, _GetWorldCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLocalCenter() + LUAX_IMPL_METHOD(Body, _GetLocalCenter) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularVelocity() + LUAX_IMPL_METHOD(Body, _GetAngularVelocity) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMass() + LUAX_IMPL_METHOD(Body, _GetMass) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetInertia() + LUAX_IMPL_METHOD(Body, _GetInertia) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetMassData() + LUAX_IMPL_METHOD(Body, _GetMassData) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetAngularDamping() + LUAX_IMPL_METHOD(Body, _GetAngularDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetLinearDamping() + LUAX_IMPL_METHOD(Body, _GetLinearDamping) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + // body:GetGravityScale() + LUAX_IMPL_METHOD(Body, _GetGravityScale) + { + LUAX_PREPARE(L, Body); + + return 0; + } + + } +} diff --git a/source/modules/asura-box2d/physics/binding/_world.cpp b/source/modules/asura-box2d/physics/binding/_world.cpp new file mode 100644 index 0000000..6edd193 --- /dev/null +++ b/source/modules/asura-box2d/physics/binding/_world.cpp @@ -0,0 +1,21 @@ +#include "../world.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Physics + { + + LUAX_REGISTRY(World) + { + + } + + LUAX_POSTPROCESS(World) + { + + } + + } +} diff --git a/source/modules/asura-box2d/physics/body.h b/source/modules/asura-box2d/physics/body.h new file mode 100644 index 0000000..57295c6 --- /dev/null +++ b/source/modules/asura-box2d/physics/body.h @@ -0,0 +1,65 @@ +#ifndef __ASURA_BOX2D_BODY_H__ +#define __ASURA_BOX2D_BODY_H__ + +#include + +#include + +namespace AsuraEngine +{ + namespace Physics + { + + class World; + + enum BodyType + { + BODY_TYPE_INVALID, + BODY_TYPE_STATIC, + BODY_TYPE_DYNAMIC, + BODY_TYPE_KINEMATIC, + BODY_TYPE_MAX_ENUM + }; + + class Body + : public AEScripting::Portable + { + public: + + LUAX_DECL_FACTORY(Body); + + b2Body *body; + + private: + + //----------------------------------------------------------------------------// + + LUAX_DECL_ENUM(BodyType); + + LUAX_DECL_METHOD(_GetType); + LUAX_DECL_METHOD(_GetX); + LUAX_DECL_METHOD(_GetY); + LUAX_DECL_METHOD(_GetAngle); + LUAX_DECL_METHOD(_GetPosition); + LUAX_DECL_METHOD(_GetLinearVelocity); + LUAX_DECL_METHOD(_GetWorldCenter); + LUAX_DECL_METHOD(_GetLocalCenter); + LUAX_DECL_METHOD(_GetAngularVelocity); + LUAX_DECL_METHOD(_GetMass); + LUAX_DECL_METHOD(_GetInertia); + LUAX_DECL_METHOD(_GetMassData); + LUAX_DECL_METHOD(_GetAngularDamping); + LUAX_DECL_METHOD(_GetLinearDamping); + LUAX_DECL_METHOD(_GetGravityScale); + LUAX_DECL_METHOD(_GetGravityScale); + + //----------------------------------------------------------------------------// + + World* mWorld; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-box2d/physics/chain_shape.h b/source/modules/asura-box2d/physics/chain_shape.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/circle_shape.h b/source/modules/asura-box2d/physics/circle_shape.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/contact.h b/source/modules/asura-box2d/physics/contact.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/debug_draw.h b/source/modules/asura-box2d/physics/debug_draw.h new file mode 100644 index 0000000..cff682b --- /dev/null +++ b/source/modules/asura-box2d/physics/debug_draw.h @@ -0,0 +1,9 @@ +#ifndef __ASURA_BOX2D_DEBUG_DRAW_H__ +#define __ASURA_BOX2D_DEBUG_DRAW_H__ + +namespace AsuraEngine +{ + +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-box2d/physics/distance_joint.h b/source/modules/asura-box2d/physics/distance_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/edge_shape.h b/source/modules/asura-box2d/physics/edge_shape.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/fixture.h b/source/modules/asura-box2d/physics/fixture.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/friction_joint.h b/source/modules/asura-box2d/physics/friction_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/gear_joint.h b/source/modules/asura-box2d/physics/gear_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/joint.h b/source/modules/asura-box2d/physics/joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/motor_joint.h b/source/modules/asura-box2d/physics/motor_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/mouse_joint.h b/source/modules/asura-box2d/physics/mouse_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/polygon_shape.h b/source/modules/asura-box2d/physics/polygon_shape.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/prismatic_joint.h b/source/modules/asura-box2d/physics/prismatic_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/pulley_joint.h b/source/modules/asura-box2d/physics/pulley_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/revolute_joint.h b/source/modules/asura-box2d/physics/revolute_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/rope_joint.h b/source/modules/asura-box2d/physics/rope_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/shape.h b/source/modules/asura-box2d/physics/shape.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/weld_joint.h b/source/modules/asura-box2d/physics/weld_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/wheel_joint.h b/source/modules/asura-box2d/physics/wheel_joint.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-box2d/physics/world.h b/source/modules/asura-box2d/physics/world.h new file mode 100644 index 0000000..0aac0c8 --- /dev/null +++ b/source/modules/asura-box2d/physics/world.h @@ -0,0 +1,19 @@ +#ifndef __ASURA_BOX2D_WORLD_H__ +#define __ASURA_BOX2D_WORLD_H__ + +#include + +namespace AsuraEngine +{ + namespace Physics + { + + class World : public AEScripting::Portable + { + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-box2d/polygon_shape.h b/source/modules/asura-box2d/polygon_shape.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/prismatic_joint.h b/source/modules/asura-box2d/prismatic_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/pulley_joint.h b/source/modules/asura-box2d/pulley_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/revolute_joint.h b/source/modules/asura-box2d/revolute_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/rope_joint.h b/source/modules/asura-box2d/rope_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/shape.h b/source/modules/asura-box2d/shape.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/weld_joint.h b/source/modules/asura-box2d/weld_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/wheel_joint.h b/source/modules/asura-box2d/wheel_joint.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-box2d/world.h b/source/modules/asura-box2d/world.h deleted file mode 100644 index 0aac0c8..0000000 --- a/source/modules/asura-box2d/world.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __ASURA_BOX2D_WORLD_H__ -#define __ASURA_BOX2D_WORLD_H__ - -#include - -namespace AsuraEngine -{ - namespace Physics - { - - class World : public AEScripting::Portable - { - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-core/core_config.h b/source/modules/asura-core/core_config.h index 06eecc7..2286189 100644 --- a/source/modules/asura-core/core_config.h +++ b/source/modules/asura-core/core_config.h @@ -1,8 +1,6 @@ #ifndef __ASURA_CORE_CONFIG_H__ #define __ASURA_CORE_CONFIG_H__ -#define ASURA_CORE_SDL 1 -#define ASURA_CORE_GLUT 0 -#define ASURA_CORE_GLFW 0 +#define ASURA_WINDOW_SDL 1 #endif \ No newline at end of file diff --git a/source/modules/asura-core/core_module.cpp b/source/modules/asura-core/core_module.cpp index 6f484c0..e6b0dac 100644 --- a/source/modules/asura-core/core_module.cpp +++ b/source/modules/asura-core/core_module.cpp @@ -1,14 +1,21 @@ #include "core_module.h" using namespace AEThreading; +using namespace AEGraphics; +using namespace AEWnd; namespace AsuraEngine { void CoreModule::Initialize(Luax::LuaxState& state) { + // Graphics + LUAX_REGISTER_ABSTRACT_FACTORY(state, Texture); + LUAX_REGISTER_FACTORY(state, Image); + // Wnd + LUAX_REGISTER_SINGLETON(state, Window); // Threading - LUAX_REGISTER_FACTORY(state, ThreadEx); + //LUAX_REGISTER_FACTORY(state, ThreadEx); } void CoreModule::Finalize(Luax::LuaxState& state) diff --git a/source/modules/asura-core/core_module.h b/source/modules/asura-core/core_module.h index a295b18..613a806 100644 --- a/source/modules/asura-core/core_module.h +++ b/source/modules/asura-core/core_module.h @@ -3,6 +3,11 @@ #include +#include "graphics/image.h" +#include "graphics/texture.h" + +#include "wnd/window.h" + #include "threading/thread_ex.h" namespace AsuraEngine diff --git a/source/modules/asura-core/graphics/binding/_image.cpp b/source/modules/asura-core/graphics/binding/_image.cpp index 1d43067..cc9a669 100644 --- a/source/modules/asura-core/graphics/binding/_image.cpp +++ b/source/modules/asura-core/graphics/binding/_image.cpp @@ -9,6 +9,8 @@ namespace AsuraEngine LUAX_REGISTRY(Image) { + LUAX_INHERIT(state, Texture); + LUAX_REGISTER_METHODS(state, { "New", _New }, { "Refresh", _Refresh }, @@ -22,55 +24,68 @@ namespace AsuraEngine LUAX_POSTPROCESS(Image) { - } - // Image.New() + // image = Image.New() LUAX_IMPL_METHOD(Image, _New) { LUAX_STATE(L); - - return 0; + Image* img = new Image(); + img->PushLuaxUserdata(state); + return 1; } - // image:Refresh() + // successed = image:Refresh(imgData) LUAX_IMPL_METHOD(Image, _Refresh) { LUAX_PREPARE(L, Image); - - return 0; + ImageData* imgData = state.CheckUserdata(2); + bool successed = self->Refresh(imgData); + if (successed) + self->SetLuaxMemberRef(state, self->mImageDataRef, 2); + state.Push(successed); + return 1; } - // image:GetWidth() + // width = image:GetWidth() LUAX_IMPL_METHOD(Image, _GetWidth) { LUAX_PREPARE(L, Image); - - return 0; + state.Push(self->GetWidth()); + return 1; } - // image:GetHeight() + // height = image:GetHeight() LUAX_IMPL_METHOD(Image, _GetHeight) { LUAX_PREPARE(L, Image); - - return 0; + state.Push(self->GetHeight()); + return 1; } - // image:GetSize() + // width, height = image:GetSize() LUAX_IMPL_METHOD(Image, _GetSize) { LUAX_PREPARE(L, Image); - - return 0; + int width = self->GetWidth(); + int height = self->GetHeight(); + state.Push(width); + state.Push(height); + return 2; } - // image:GetPixel() + // color32 = image:GetPixel(x, y) LUAX_IMPL_METHOD(Image, _GetPixel) { LUAX_PREPARE(L, Image); - return 0; + uint x, y; + x = state.CheckValue(2); + y = state.CheckValue(3); + Color32* c32 = new Color32(); + c32->Set(self->GetPixel(x, y)); + c32->PushLuaxUserdata(state); + return 1; } // image:Render() diff --git a/source/modules/asura-core/graphics/binding/_texture.cpp b/source/modules/asura-core/graphics/binding/_texture.cpp new file mode 100644 index 0000000..489d362 --- /dev/null +++ b/source/modules/asura-core/graphics/binding/_texture.cpp @@ -0,0 +1,86 @@ +#include "../texture.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace Graphics + { + + LUAX_REGISTRY(Texture) + { + LUAX_REGISTER_METHODS(state, + { "SetFilterMode", _SetFilterMode }, + { "SetWrapMode", _SetWrapMode }, + { "GetFilterMode", _GetFilterMode }, + { "GetWrapMode", _GetWrapMode }, + { "IsGenMipmap", _IsGenMipmap } + ); + } + + LUAX_POSTPROCESS(Texture) + { + LUAX_REGISTER_ENUM(state, "EColorFormat", + { "UNKNOWN", COLOR_FORMAT_UNKNOWN }, + { "RGBA8", COLOR_FORMAT_RGBA8 }, + { "RGBA32F", COLOR_FORMAT_RGBA32F } + ); + LUAX_REGISTER_ENUM(state, "EFilterMode", + { "NEAREST", FILTER_MODE_NEAREST }, + { "LINEAR", FILTER_MODE_LINEAR } + ); + LUAX_REGISTER_ENUM(state, "EWrapMode", + { "REPEAT", WRAP_MODE_REPEAT }, + { "MIRROR", WRAP_MODE_MIRROR }, + { "CLAMPTOEDGE", WRAP_MODE_CLAMPTOEDGE }, + { "CLAMPTOBORDER", WRAP_MODE_CLAMPTOBORDER } + ); + + } + + // texture:SetFilterMode(minFilter, magFilter) + LUAX_IMPL_METHOD(Texture, _SetFilterMode) + { + LUAX_PREPARE(L, Texture); + FilterMode min = (FilterMode)state.CheckValue(2); + FilterMode mag = (FilterMode)state.CheckValue(3); + self->SetFilterMode(min, mag); + return 0; + } + + // texture:SetWrapMode(wrap_mode) + LUAX_IMPL_METHOD(Texture, _SetWrapMode) + { + LUAX_PREPARE(L, Texture); + WrapMode wrap_mode = (WrapMode)state.CheckValue(2); + self->SetWrapMode(wrap_mode); + return 0; + } + + // min, mag = texture:GetFilterMode() + LUAX_IMPL_METHOD(Texture, _GetFilterMode) + { + LUAX_PREPARE(L, Texture); + state.Push((int)self->mMinFilter); + state.Push((int)self->mMagFilter); + return 2; + } + + // wrapmode= texture:GetWrapMode() + LUAX_IMPL_METHOD(Texture, _GetWrapMode) + { + LUAX_PREPARE(L, Texture); + state.Push((int)self->mWrapMode); + return 1; + } + + // texture:IsGenMipmap() + LUAX_IMPL_METHOD(Texture, _IsGenMipmap) + { + LUAX_PREPARE(L, Texture); + state.Push(self->IsGenMipmap()); + return 1; + } + + } +} \ No newline at end of file diff --git a/source/modules/asura-core/graphics/binding/_window.cpp b/source/modules/asura-core/graphics/binding/_window.cpp deleted file mode 100644 index fc74d6c..0000000 --- a/source/modules/asura-core/graphics/binding/_window.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "../window.h" - -using namespace std; - -namespace AsuraEngine -{ - namespace Graphics - { - - LUAX_REGISTRY(Window) - { - LUAX_REGISTER_METHODS(state, - { "Show", _Show }, - { "Hide", _Hide }, - { "SetResolution", _SetResolution }, - { "SetFullScreen", _SetFullScreen }, - { "SetTitle", _SetTitle }, - { "SetWindowStyle", _SetWindowStyle }, - { "Clear", _Clear }, - { "Draw", _Draw }, - { "SwapRenderBuffer", _SwapRenderBuffer } - ); - } - - LUAX_POSTPROCESS(Window) - { - - } - - // window:Show() - LUAX_IMPL_METHOD(Window, _Show) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:Hide() - LUAX_IMPL_METHOD(Window, _Hide) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:SetResolution() - LUAX_IMPL_METHOD(Window, _SetResolution) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:SetFullScreen() - LUAX_IMPL_METHOD(Window, _SetFullScreen) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:SetTitle() - LUAX_IMPL_METHOD(Window, _SetTitle) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:SetWindowStyle() - LUAX_IMPL_METHOD(Window, _SetWindowStyle) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:Clear() - LUAX_IMPL_METHOD(Window, _Clear) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:Draw() - LUAX_IMPL_METHOD(Window, _Draw) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - // window:SwapRenderBuffer() - LUAX_IMPL_METHOD(Window, _SwapRenderBuffer) - { - LUAX_PREPARE(L, Window); - - return 0; - } - - } -} diff --git a/source/modules/asura-core/graphics/canvas.cpp b/source/modules/asura-core/graphics/canvas.cpp index e54ba1f..8b556d9 100644 --- a/source/modules/asura-core/graphics/canvas.cpp +++ b/source/modules/asura-core/graphics/canvas.cpp @@ -14,7 +14,7 @@ namespace AsuraEngine GLint current_fbo; glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); glBindFramebuffer(GL_FRAMEBUFFER, mFBO); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexHandle, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTex, 0); glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); } @@ -22,7 +22,7 @@ namespace AsuraEngine { GLint current_tex; glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_tex); - glBindTexture(GL_TEXTURE_2D, mTexHandle); + glBindTexture(GL_TEXTURE_2D, mTex); glBindTexture(GL_TEXTURE_2D, current_tex); } diff --git a/source/modules/asura-core/graphics/canvas.h b/source/modules/asura-core/graphics/canvas.h index d1412da..f0b71e2 100644 --- a/source/modules/asura-core/graphics/canvas.h +++ b/source/modules/asura-core/graphics/canvas.h @@ -62,7 +62,7 @@ namespace AsuraEngine //----------------------------------------------------------------------------// - LUAX_DECL_FACTORY(SimCanvas); + LUAX_DECL_FACTORY(Canvas); LUAX_DECL_METHOD(_SetSize); LUAX_DECL_METHOD(_Bind); diff --git a/source/modules/asura-core/graphics/color32.cpp b/source/modules/asura-core/graphics/color32.cpp index 0ebc77c..28260d5 100644 --- a/source/modules/asura-core/graphics/color32.cpp +++ b/source/modules/asura-core/graphics/color32.cpp @@ -6,6 +6,14 @@ namespace AsuraEngine namespace Graphics { +#if ASURA_LITTLE_ENDIAN + // СˣֽڵAlphaڸߵַ + const uint32 Color32::RMASK = 0x000000ff; + const uint32 Color32::GMASK = 0x0000ff00; + const uint32 Color32::BMASK = 0x00ff0000; + const uint32 Color32::AMASK = 0xff000000; +#endif + Color32::Color32() { r = g = b = a = 0; @@ -35,5 +43,13 @@ namespace AsuraEngine this->a = a; } + void Color32::Set(const Color32& c32) + { + r = c32.r; + g = c32.g; + b = c32.b; + a = c32.a; + } + } } \ No newline at end of file diff --git a/source/modules/asura-core/graphics/color32.h b/source/modules/asura-core/graphics/color32.h index 2b13d1a..5b10931 100644 --- a/source/modules/asura-core/graphics/color32.h +++ b/source/modules/asura-core/graphics/color32.h @@ -22,6 +22,11 @@ namespace AsuraEngine LUAX_DECL_FACTORY(Color32); + static const uint32 RMASK; + static const uint32 GMASK; + static const uint32 BMASK; + static const uint32 AMASK; + Color32(); ~Color32(); @@ -32,6 +37,8 @@ namespace AsuraEngine Color32(byte r, byte g, byte b, byte a); + void Set(const Color32& c32); + byte r, g, b, a; LUAX_DECL_METHOD(_ToColor); diff --git a/source/modules/asura-core/graphics/image.cpp b/source/modules/asura-core/graphics/image.cpp index e0528eb..bdd8c3d 100644 --- a/source/modules/asura-core/graphics/image.cpp +++ b/source/modules/asura-core/graphics/image.cpp @@ -26,16 +26,13 @@ namespace AsuraEngine ImageData* imgData = static_cast(data); ASSERT(imgData); - glBindTexture(GL_TEXTURE_2D, mTexHandle); + glBindTexture(GL_TEXTURE_2D, mTex); imgData->Lock(); - int width = imgData->width; int height = imgData->height; - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, imgData->pixels); mImageData = imgData; - imgData->Unlock(); glBindTexture(GL_TEXTURE_2D, 0); diff --git a/source/modules/asura-core/graphics/image.h b/source/modules/asura-core/graphics/image.h index 377e002..06108ed 100644 --- a/source/modules/asura-core/graphics/image.h +++ b/source/modules/asura-core/graphics/image.h @@ -33,7 +33,7 @@ namespace AsuraEngine { public: - LUAX_DECL_FACTORY(SimImage); + LUAX_DECL_FACTORY(Image); Image(); @@ -46,11 +46,9 @@ namespace AsuraEngine bool Refresh(AEIO::DecodedData* decodeData) override; bool Refresh(AEIO::DecodedData* decodeData, const AEMath::Recti& rect); - - uint GetWidth(); - uint GetHeight(); - Math::Vector2u GetSize(); - Color32 GetPixel(uint x, uint y); + uint GetWidth(); + uint GetHeight(); + Color32 GetPixel(uint x, uint y); void Render(const RenderTarget* rt, const RenderState& state) override; diff --git a/source/modules/asura-core/graphics/shader.cpp b/source/modules/asura-core/graphics/shader.cpp index 1a85866..c0c6f75 100644 --- a/source/modules/asura-core/graphics/shader.cpp +++ b/source/modules/asura-core/graphics/shader.cpp @@ -27,7 +27,7 @@ namespace AsuraEngine GLuint Shader::GetGLProgramHandle() { - return mProgramHandle; + return mProgram; } void Shader::Use() diff --git a/source/modules/asura-core/graphics/shader.h b/source/modules/asura-core/graphics/shader.h index 8c21ab2..df0fcca 100644 --- a/source/modules/asura-core/graphics/shader.h +++ b/source/modules/asura-core/graphics/shader.h @@ -13,6 +13,7 @@ #include #include +#include "shader_source.h" #include "color.h" #include "texture.h" #include "gl.h" @@ -23,8 +24,9 @@ namespace AsuraEngine { /// - /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩuniformsuseɫķ༭ - /// ÿshaderͨshaderҵuniforms¶frameworkmaterialá + /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩ + /// uniformsuseɫķ༭ÿshaderͨshaderҵuniforms + /// ¶frameworkmaterialá /// class Shader ASURA_FINAL : public Scripting::Portable @@ -32,15 +34,18 @@ namespace AsuraEngine { public: + LUAX_DECL_FACTORY(Shader); + Shader(); ~Shader(); /// - /// ӴshaderʱȼǷϴλuniforms location mapʹglAttachShader±ɫ - /// ɫ + /// ӴshaderʱȼǷϴλuniforms location mapʹ + /// glAttachShader±ɫɫ /// - bool Load(const std::string& vertexShader, const std::string& fragmentShader); + //bool Load(const std::string& vertexShader, const std::string& fragmentShader); + bool Refresh(AEIO::DecodedData* decodeData) override; /// /// shaderΪ @@ -92,13 +97,13 @@ namespace AsuraEngine /// /// OpenGL shader program handle. /// - GLuint mProgramHandle; + GLuint mProgram; - //------------------------------------------------------------------------------// + Luax::LuaxMemberRef mCodeRef; - public: + private: - LUAX_DECL_FACTORY(SimShader); + //----------------------------------------------------------------------------// LUAX_DECL_METHOD(_New); LUAX_DECL_METHOD(_Use); @@ -114,9 +119,7 @@ namespace AsuraEngine LUAX_DECL_METHOD(_SetUniformVector4); LUAX_DECL_METHOD(_SetUniformColor); - private: - - Luax::LuaxMemberRef mCodeLuaRef; + //----------------------------------------------------------------------------// }; diff --git a/source/modules/asura-core/graphics/shader_source.h b/source/modules/asura-core/graphics/shader_source.h new file mode 100644 index 0000000..b3e815c --- /dev/null +++ b/source/modules/asura-core/graphics/shader_source.h @@ -0,0 +1,30 @@ +#ifndef __ASURA_SHADER_SOURCE_H__ +#define __ASURA_SHADER_SOURCE_H__ + +#include + +#include + +namespace AsuraEngine +{ + namespace Graphics + { + + /// + /// Asura EngineʹõshaderԴ룬GLSL + /// + class ShaderSouce : public AEIO::DecodedData + { + public: + void Decode(AEIO::DataBuffer& buffer) override; + + private: + std::string mVert; + std::string mFrag; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-core/graphics/texture.cpp b/source/modules/asura-core/graphics/texture.cpp index 0897702..c260ce9 100644 --- a/source/modules/asura-core/graphics/texture.cpp +++ b/source/modules/asura-core/graphics/texture.cpp @@ -6,20 +6,20 @@ namespace AsuraEngine { Texture::Texture() - : mTexHandle(0) + : mTex(0) { // GL texture - glGenTextures(1, &mTexHandle); + glGenTextures(1, &mTex); } Texture::~Texture() { - glDeleteTextures(1, &mTexHandle); + glDeleteTextures(1, &mTex); } GLuint Texture::GetGLTextureHandle() const { - return mTexHandle; + return mTex; } } diff --git a/source/modules/asura-core/graphics/texture.h b/source/modules/asura-core/graphics/texture.h index a76e1d4..02d3407 100644 --- a/source/modules/asura-core/graphics/texture.h +++ b/source/modules/asura-core/graphics/texture.h @@ -22,7 +22,6 @@ namespace AsuraEngine WRAP_MODE_MIRROR, WRAP_MODE_CLAMPTOEDGE, WRAP_MODE_CLAMPTOBORDER, - //WRAP_MODE_PERAXIS, // UVвͬ4ֵ }; enum FilterMode @@ -47,11 +46,11 @@ namespace AsuraEngine /// ϲԵѿϵΪ׼EditorҲϽΪԭ㣬Ϊ /// 㡣 /// - ASURA_ABSTRACT class Texture + ASURA_ABSTRACT class Texture : virtual public AEScripting::NativeAccessor { public: - LUAX_DECL_ABSTRACT_FACTORY(); + LUAX_DECL_ABSTRACT_FACTORY(Texture); Texture(); virtual ~Texture(); @@ -67,7 +66,7 @@ namespace AsuraEngine /// /// UVfilterΪ /// - void IsGenMipmap(); + bool IsGenMipmap(); /// /// ȾtexturertϣԭϽǣң @@ -81,11 +80,21 @@ namespace AsuraEngine protected: - LUAX_DECL_ENUM(ColorFormat); - LUAX_DECL_ENUM(FilterMode); - LUAX_DECL_ENUM(WrapMode); + //----------------------------------------------------------------------------// - GLuint mTexHandle; + LUAX_DECL_ENUM(ColorFormat, 1); + LUAX_DECL_ENUM(FilterMode, 1); + LUAX_DECL_ENUM(WrapMode, 1); + + LUAX_DECL_METHOD(_SetFilterMode); + LUAX_DECL_METHOD(_SetWrapMode); + LUAX_DECL_METHOD(_GetFilterMode); + LUAX_DECL_METHOD(_GetWrapMode); + LUAX_DECL_METHOD(_IsGenMipmap); + + //----------------------------------------------------------------------------// + + GLuint mTex; FilterMode mMinFilter; FilterMode mMagFilter; diff --git a/source/modules/asura-core/input/cursor.defs b/source/modules/asura-core/input/cursor.defs deleted file mode 100644 index f8b8492..0000000 --- a/source/modules/asura-core/input/cursor.defs +++ /dev/null @@ -1,25 +0,0 @@ - -// Types of system cursors. -enum SystemCursor -{ - CURSOR_ARROW, - CURSOR_IBEAM, - CURSOR_WAIT, - CURSOR_CROSSHAIR, - CURSOR_WAITARROW, - CURSOR_SIZENWSE, - CURSOR_SIZENESW, - CURSOR_SIZEWE, - CURSOR_SIZENS, - CURSOR_SIZEALL, - CURSOR_NO, - CURSOR_HAND, - CURSOR_MAX_ENUM -}; - -enum CursorType -{ - CURSORTYPE_SYSTEM, - CURSORTYPE_IMAGE, - CURSORTYPE_MAX_ENUM -}; diff --git a/source/modules/asura-core/input/cursor.h b/source/modules/asura-core/input/cursor.h index 05503ee..d420d66 100644 --- a/source/modules/asura-core/input/cursor.h +++ b/source/modules/asura-core/input/cursor.h @@ -16,6 +16,31 @@ namespace AsuraEngine class CursorImpl; + // Types of system cursors. + enum SystemCursor + { + CURSOR_ARROW, + CURSOR_IBEAM, + CURSOR_WAIT, + CURSOR_CROSSHAIR, + CURSOR_WAITARROW, + CURSOR_SIZENWSE, + CURSOR_SIZENESW, + CURSOR_SIZEWE, + CURSOR_SIZENS, + CURSOR_SIZEALL, + CURSOR_NO, + CURSOR_HAND, + CURSOR_MAX_ENUM + }; + + enum CursorType + { + CURSORTYPE_SYSTEM, + CURSORTYPE_IMAGE, + CURSORTYPE_MAX_ENUM + }; + // ָö #include "Cursor.defs" diff --git a/source/modules/asura-core/input/equeue.cpp b/source/modules/asura-core/input/equeue.cpp new file mode 100644 index 0000000..e165393 --- /dev/null +++ b/source/modules/asura-core/input/equeue.cpp @@ -0,0 +1,28 @@ +#include "equeue.h" + +namespace AsuraEngine +{ + namespace Input + { + + EQueue::EQueue() + { + // try create queue + + ASSERT(mImpl); + } + + EQueue::~EQueue() + { + if(mImpl) + delete mImpl; + } + + bool EQueue::Poll(const Event& e) + { + ASSERT(mImpl); + return mImpl->Poll(e); + } + + } +} \ No newline at end of file diff --git a/source/modules/asura-core/input/equeue.h b/source/modules/asura-core/input/equeue.h new file mode 100644 index 0000000..495c869 --- /dev/null +++ b/source/modules/asura-core/input/equeue.h @@ -0,0 +1,51 @@ +#ifndef __ASURA_EQUEUE_H__ +#define __ASURA_EQUEUE_H__ + +#include + +#include "event.h" + +namespace AsuraEngine +{ + namespace Input + { + + class EQueueImpl; + + /// + /// Event queue. + /// + class EQueue + { + public: + + EQueue(); + ~EQueue(); + + bool Poll(const Event& e); + + private: + + EQueueImpl* mImpl; + + }; + + ASURA_ABSTRACT class EQueueImpl + { + public: + + EQueueImpl() {}; + virtual ~EQueueImpl() {}; + + /// + /// Ӳϵͳ¼óһءзtrue,ûзfalseص + /// װЩͬʵֵ¼ʹͳһתΪAsura event + /// + virtual bool Poll(const Event&) = 0; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-core/input/equeue_impl_sdl.h b/source/modules/asura-core/input/equeue_impl_sdl.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/input/equeue_impl_win32.h b/source/modules/asura-core/input/equeue_impl_win32.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/input/event_manager.h b/source/modules/asura-core/input/event_manager.h new file mode 100644 index 0000000..b81b7ff --- /dev/null +++ b/source/modules/asura-core/input/event_manager.h @@ -0,0 +1,24 @@ +#ifndef __ASURA_EVENT_MANANGER_H__ +#define __ASURA_EVENT_MANANGER_H__ + +#include "equeue.h" + +namespace AsuraEngine +{ + namespace Input + { + + class EventManager + { + public: + + private: + + EQueue mQueue; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-core/input/keyboard.defs b/source/modules/asura-core/input/keyboard.defs deleted file mode 100644 index 8f04dc2..0000000 --- a/source/modules/asura-core/input/keyboard.defs +++ /dev/null @@ -1,482 +0,0 @@ - -/** -* Keyboard keys. They are dependent on the current layout of the keyboard. -**/ -enum Key -{ - KEY_UNKNOWN, - - KEY_RETURN, - KEY_ESCAPE, - KEY_BACKSPACE, - KEY_TAB, - KEY_SPACE, - KEY_EXCLAIM, - KEY_QUOTEDBL, - KEY_HASH, - KEY_PERCENT, - KEY_DOLLAR, - KEY_AMPERSAND, - KEY_QUOTE, - KEY_LEFTPAREN, - KEY_RIGHTPAREN, - KEY_ASTERISK, - KEY_PLUS, - KEY_COMMA, - KEY_MINUS, - KEY_PERIOD, - KEY_SLASH, - KEY_0, - KEY_1, - KEY_2, - KEY_3, - KEY_4, - KEY_5, - KEY_6, - KEY_7, - KEY_8, - KEY_9, - KEY_COLON, - KEY_SEMICOLON, - KEY_LESS, - KEY_EQUALS, - KEY_GREATER, - KEY_QUESTION, - KEY_AT, - - KEY_LEFTBRACKET, - KEY_BACKSLASH, - KEY_RIGHTBRACKET, - KEY_CARET, - KEY_UNDERSCORE, - KEY_BACKQUOTE, - KEY_A, - KEY_B, - KEY_C, - KEY_D, - KEY_E, - KEY_F, - KEY_G, - KEY_H, - KEY_I, - KEY_J, - KEY_K, - KEY_L, - KEY_M, - KEY_N, - KEY_O, - KEY_P, - KEY_Q, - KEY_R, - KEY_S, - KEY_T, - KEY_U, - KEY_V, - KEY_W, - KEY_X, - KEY_Y, - KEY_Z, - - KEY_CAPSLOCK, - - KEY_F1, - KEY_F2, - KEY_F3, - KEY_F4, - KEY_F5, - KEY_F6, - KEY_F7, - KEY_F8, - KEY_F9, - KEY_F10, - KEY_F11, - KEY_F12, - - KEY_PRINTSCREEN, - KEY_SCROLLLOCK, - KEY_PAUSE, - KEY_INSERT, - KEY_HOME, - KEY_PAGEUP, - KEY_DELETE, - KEY_END, - KEY_PAGEDOWN, - KEY_RIGHT, - KEY_LEFT, - KEY_DOWN, - KEY_UP, - - KEY_NUMLOCKCLEAR, - KEY_KP_DIVIDE, - KEY_KP_MULTIPLY, - KEY_KP_MINUS, - KEY_KP_PLUS, - KEY_KP_ENTER, - KEY_KP_1, - KEY_KP_2, - KEY_KP_3, - KEY_KP_4, - KEY_KP_5, - KEY_KP_6, - KEY_KP_7, - KEY_KP_8, - KEY_KP_9, - KEY_KP_0, - KEY_KP_PERIOD, - KEY_KP_COMMA, - KEY_KP_EQUALS, - - KEY_APPLICATION, - KEY_POWER, - KEY_F13, - KEY_F14, - KEY_F15, - KEY_F16, - KEY_F17, - KEY_F18, - KEY_F19, - KEY_F20, - KEY_F21, - KEY_F22, - KEY_F23, - KEY_F24, - KEY_EXECUTE, - KEY_HELP, - KEY_MENU, - KEY_SELECT, - KEY_STOP, - KEY_AGAIN, - KEY_UNDO, - KEY_CUT, - KEY_COPY, - KEY_PASTE, - KEY_FIND, - KEY_MUTE, - KEY_VOLUMEUP, - KEY_VOLUMEDOWN, - - KEY_ALTERASE, - KEY_SYSREQ, - KEY_CANCEL, - KEY_CLEAR, - KEY_PRIOR, - KEY_RETURN2, - KEY_SEPARATOR, - KEY_OUT, - KEY_OPER, - KEY_CLEARAGAIN, - - KEY_THOUSANDSSEPARATOR, - KEY_DECIMALSEPARATOR, - KEY_CURRENCYUNIT, - KEY_CURRENCYSUBUNIT, - - KEY_LCTRL, - KEY_LSHIFT, - KEY_LALT, - KEY_LGUI, - KEY_RCTRL, - KEY_RSHIFT, - KEY_RALT, - KEY_RGUI, - - KEY_MODE, - - KEY_AUDIONEXT, - KEY_AUDIOPREV, - KEY_AUDIOSTOP, - KEY_AUDIOPLAY, - KEY_AUDIOMUTE, - KEY_MEDIASELECT, - KEY_WWW, - KEY_MAIL, - KEY_CALCULATOR, - KEY_COMPUTER, - KEY_APP_SEARCH, - KEY_APP_HOME, - KEY_APP_BACK, - KEY_APP_FORWARD, - KEY_APP_STOP, - KEY_APP_REFRESH, - KEY_APP_BOOKMARKS, - - KEY_BRIGHTNESSDOWN, - KEY_BRIGHTNESSUP, - KEY_DISPLAYSWITCH, - KEY_KBDILLUMTOGGLE, - KEY_KBDILLUMDOWN, - KEY_KBDILLUMUP, - KEY_EJECT, - KEY_SLEEP, - - KEY_MAX_ENUM -}; - -/** -* Scancodes represent physical keys independent of the current layout. -* Their names may not match the names of the keys printed on the keyboard. -* Some of them are very esoteric... -**/ -enum Scancode -{ - SCANCODE_UNKNOWN, - - SCANCODE_A, - SCANCODE_B, - SCANCODE_C, - SCANCODE_D, - SCANCODE_E, - SCANCODE_F, - SCANCODE_G, - SCANCODE_H, - SCANCODE_I, - SCANCODE_J, - SCANCODE_K, - SCANCODE_L, - SCANCODE_M, - SCANCODE_N, - SCANCODE_O, - SCANCODE_P, - SCANCODE_Q, - SCANCODE_R, - SCANCODE_S, - SCANCODE_T, - SCANCODE_U, - SCANCODE_V, - SCANCODE_W, - SCANCODE_X, - SCANCODE_Y, - SCANCODE_Z, - - SCANCODE_1, - SCANCODE_2, - SCANCODE_3, - SCANCODE_4, - SCANCODE_5, - SCANCODE_6, - SCANCODE_7, - SCANCODE_8, - SCANCODE_9, - SCANCODE_0, - - SCANCODE_RETURN, - SCANCODE_ESCAPE, - SCANCODE_BACKSPACE, - SCANCODE_TAB, - SCANCODE_SPACE, - - SCANCODE_MINUS, - SCANCODE_EQUALS, - SCANCODE_LEFTBRACKET, - SCANCODE_RIGHTBRACKET, - SCANCODE_BACKSLASH, - SCANCODE_NONUSHASH, - SCANCODE_SEMICOLON, - SCANCODE_APOSTROPHE, - SCANCODE_GRAVE, - SCANCODE_COMMA, - SCANCODE_PERIOD, - SCANCODE_SLASH, - - SCANCODE_CAPSLOCK, - - SCANCODE_F1, - SCANCODE_F2, - SCANCODE_F3, - SCANCODE_F4, - SCANCODE_F5, - SCANCODE_F6, - SCANCODE_F7, - SCANCODE_F8, - SCANCODE_F9, - SCANCODE_F10, - SCANCODE_F11, - SCANCODE_F12, - - SCANCODE_PRINTSCREEN, - SCANCODE_SCROLLLOCK, - SCANCODE_PAUSE, - SCANCODE_INSERT, - SCANCODE_HOME, - SCANCODE_PAGEUP, - SCANCODE_DELETE, - SCANCODE_END, - SCANCODE_PAGEDOWN, - SCANCODE_RIGHT, - SCANCODE_LEFT, - SCANCODE_DOWN, - SCANCODE_UP, - - SCANCODE_NUMLOCKCLEAR, - SCANCODE_KP_DIVIDE, - SCANCODE_KP_MULTIPLY, - SCANCODE_KP_MINUS, - SCANCODE_KP_PLUS, - SCANCODE_KP_ENTER, - SCANCODE_KP_1, - SCANCODE_KP_2, - SCANCODE_KP_3, - SCANCODE_KP_4, - SCANCODE_KP_5, - SCANCODE_KP_6, - SCANCODE_KP_7, - SCANCODE_KP_8, - SCANCODE_KP_9, - SCANCODE_KP_0, - SCANCODE_KP_PERIOD, - - SCANCODE_NONUSBACKSLASH, - SCANCODE_APPLICATION, - SCANCODE_POWER, - SCANCODE_KP_EQUALS, - SCANCODE_F13, - SCANCODE_F14, - SCANCODE_F15, - SCANCODE_F16, - SCANCODE_F17, - SCANCODE_F18, - SCANCODE_F19, - SCANCODE_F20, - SCANCODE_F21, - SCANCODE_F22, - SCANCODE_F23, - SCANCODE_F24, - SCANCODE_EXECUTE, - SCANCODE_HELP, - SCANCODE_MENU, - SCANCODE_SELECT, - SCANCODE_STOP, - SCANCODE_AGAIN, - SCANCODE_UNDO, - SCANCODE_CUT, - SCANCODE_COPY, - SCANCODE_PASTE, - SCANCODE_FIND, - SCANCODE_MUTE, - SCANCODE_VOLUMEUP, - SCANCODE_VOLUMEDOWN, - SCANCODE_KP_COMMA, - SCANCODE_KP_EQUALSAS400, - - SCANCODE_INTERNATIONAL1, - SCANCODE_INTERNATIONAL2, - SCANCODE_INTERNATIONAL3, - SCANCODE_INTERNATIONAL4, - SCANCODE_INTERNATIONAL5, - SCANCODE_INTERNATIONAL6, - SCANCODE_INTERNATIONAL7, - SCANCODE_INTERNATIONAL8, - SCANCODE_INTERNATIONAL9, - SCANCODE_LANG1, - SCANCODE_LANG2, - SCANCODE_LANG3, - SCANCODE_LANG4, - SCANCODE_LANG5, - SCANCODE_LANG6, - SCANCODE_LANG7, - SCANCODE_LANG8, - SCANCODE_LANG9, - - SCANCODE_ALTERASE, - SCANCODE_SYSREQ, - SCANCODE_CANCEL, - SCANCODE_CLEAR, - SCANCODE_PRIOR, - SCANCODE_RETURN2, - SCANCODE_SEPARATOR, - SCANCODE_OUT, - SCANCODE_OPER, - SCANCODE_CLEARAGAIN, - SCANCODE_CRSEL, - SCANCODE_EXSEL, - - SCANCODE_KP_00, - SCANCODE_KP_000, - SCANCODE_THOUSANDSSEPARATOR, - SCANCODE_DECIMALSEPARATOR, - SCANCODE_CURRENCYUNIT, - SCANCODE_CURRENCYSUBUNIT, - SCANCODE_KP_LEFTPAREN, - SCANCODE_KP_RIGHTPAREN, - SCANCODE_KP_LEFTBRACE, - SCANCODE_KP_RIGHTBRACE, - SCANCODE_KP_TAB, - SCANCODE_KP_BACKSPACE, - SCANCODE_KP_A, - SCANCODE_KP_B, - SCANCODE_KP_C, - SCANCODE_KP_D, - SCANCODE_KP_E, - SCANCODE_KP_F, - SCANCODE_KP_XOR, - SCANCODE_KP_POWER, - SCANCODE_KP_PERCENT, - SCANCODE_KP_LESS, - SCANCODE_KP_GREATER, - SCANCODE_KP_AMPERSAND, - SCANCODE_KP_DBLAMPERSAND, - SCANCODE_KP_VERTICALBAR, - SCANCODE_KP_DBLVERTICALBAR, - SCANCODE_KP_COLON, - SCANCODE_KP_HASH, - SCANCODE_KP_SPACE, - SCANCODE_KP_AT, - SCANCODE_KP_EXCLAM, - SCANCODE_KP_MEMSTORE, - SCANCODE_KP_MEMRECALL, - SCANCODE_KP_MEMCLEAR, - SCANCODE_KP_MEMADD, - SCANCODE_KP_MEMSUBTRACT, - SCANCODE_KP_MEMMULTIPLY, - SCANCODE_KP_MEMDIVIDE, - SCANCODE_KP_PLUSMINUS, - SCANCODE_KP_CLEAR, - SCANCODE_KP_CLEARENTRY, - SCANCODE_KP_BINARY, - SCANCODE_KP_OCTAL, - SCANCODE_KP_DECIMAL, - SCANCODE_KP_HEXADECIMAL, - - SCANCODE_LCTRL, - SCANCODE_LSHIFT, - SCANCODE_LALT, - SCANCODE_LGUI, - SCANCODE_RCTRL, - SCANCODE_RSHIFT, - SCANCODE_RALT, - SCANCODE_RGUI, - - SCANCODE_MODE, - - SCANCODE_AUDIONEXT, - SCANCODE_AUDIOPREV, - SCANCODE_AUDIOSTOP, - SCANCODE_AUDIOPLAY, - SCANCODE_AUDIOMUTE, - SCANCODE_MEDIASELECT, - SCANCODE_WWW, - SCANCODE_MAIL, - SCANCODE_CALCULATOR, - SCANCODE_COMPUTER, - SCANCODE_AC_SEARCH, - SCANCODE_AC_HOME, - SCANCODE_AC_BACK, - SCANCODE_AC_FORWARD, - SCANCODE_AC_STOP, - SCANCODE_AC_REFRESH, - SCANCODE_AC_BOOKMARKS, - - SCANCODE_BRIGHTNESSDOWN, - SCANCODE_BRIGHTNESSUP, - SCANCODE_DISPLAYSWITCH, - SCANCODE_KBDILLUMTOGGLE, - SCANCODE_KBDILLUMDOWN, - SCANCODE_KBDILLUMUP, - SCANCODE_EJECT, - SCANCODE_SLEEP, - - SCANCODE_APP1, - SCANCODE_APP2, - - SCANCODE_MAX_ENUM -}; diff --git a/source/modules/asura-core/input/keyboard.h b/source/modules/asura-core/input/keyboard.h index 0caf61e..d1d7b48 100644 --- a/source/modules/asura-core/input/keyboard.h +++ b/source/modules/asura-core/input/keyboard.h @@ -16,7 +16,7 @@ // public: // // // صö -// #include "Keyboard.defs" +// #include "keys.h" // // Keyboard(); // diff --git a/source/modules/asura-core/input/keys.h b/source/modules/asura-core/input/keys.h new file mode 100644 index 0000000..8f04dc2 --- /dev/null +++ b/source/modules/asura-core/input/keys.h @@ -0,0 +1,482 @@ + +/** +* Keyboard keys. They are dependent on the current layout of the keyboard. +**/ +enum Key +{ + KEY_UNKNOWN, + + KEY_RETURN, + KEY_ESCAPE, + KEY_BACKSPACE, + KEY_TAB, + KEY_SPACE, + KEY_EXCLAIM, + KEY_QUOTEDBL, + KEY_HASH, + KEY_PERCENT, + KEY_DOLLAR, + KEY_AMPERSAND, + KEY_QUOTE, + KEY_LEFTPAREN, + KEY_RIGHTPAREN, + KEY_ASTERISK, + KEY_PLUS, + KEY_COMMA, + KEY_MINUS, + KEY_PERIOD, + KEY_SLASH, + KEY_0, + KEY_1, + KEY_2, + KEY_3, + KEY_4, + KEY_5, + KEY_6, + KEY_7, + KEY_8, + KEY_9, + KEY_COLON, + KEY_SEMICOLON, + KEY_LESS, + KEY_EQUALS, + KEY_GREATER, + KEY_QUESTION, + KEY_AT, + + KEY_LEFTBRACKET, + KEY_BACKSLASH, + KEY_RIGHTBRACKET, + KEY_CARET, + KEY_UNDERSCORE, + KEY_BACKQUOTE, + KEY_A, + KEY_B, + KEY_C, + KEY_D, + KEY_E, + KEY_F, + KEY_G, + KEY_H, + KEY_I, + KEY_J, + KEY_K, + KEY_L, + KEY_M, + KEY_N, + KEY_O, + KEY_P, + KEY_Q, + KEY_R, + KEY_S, + KEY_T, + KEY_U, + KEY_V, + KEY_W, + KEY_X, + KEY_Y, + KEY_Z, + + KEY_CAPSLOCK, + + KEY_F1, + KEY_F2, + KEY_F3, + KEY_F4, + KEY_F5, + KEY_F6, + KEY_F7, + KEY_F8, + KEY_F9, + KEY_F10, + KEY_F11, + KEY_F12, + + KEY_PRINTSCREEN, + KEY_SCROLLLOCK, + KEY_PAUSE, + KEY_INSERT, + KEY_HOME, + KEY_PAGEUP, + KEY_DELETE, + KEY_END, + KEY_PAGEDOWN, + KEY_RIGHT, + KEY_LEFT, + KEY_DOWN, + KEY_UP, + + KEY_NUMLOCKCLEAR, + KEY_KP_DIVIDE, + KEY_KP_MULTIPLY, + KEY_KP_MINUS, + KEY_KP_PLUS, + KEY_KP_ENTER, + KEY_KP_1, + KEY_KP_2, + KEY_KP_3, + KEY_KP_4, + KEY_KP_5, + KEY_KP_6, + KEY_KP_7, + KEY_KP_8, + KEY_KP_9, + KEY_KP_0, + KEY_KP_PERIOD, + KEY_KP_COMMA, + KEY_KP_EQUALS, + + KEY_APPLICATION, + KEY_POWER, + KEY_F13, + KEY_F14, + KEY_F15, + KEY_F16, + KEY_F17, + KEY_F18, + KEY_F19, + KEY_F20, + KEY_F21, + KEY_F22, + KEY_F23, + KEY_F24, + KEY_EXECUTE, + KEY_HELP, + KEY_MENU, + KEY_SELECT, + KEY_STOP, + KEY_AGAIN, + KEY_UNDO, + KEY_CUT, + KEY_COPY, + KEY_PASTE, + KEY_FIND, + KEY_MUTE, + KEY_VOLUMEUP, + KEY_VOLUMEDOWN, + + KEY_ALTERASE, + KEY_SYSREQ, + KEY_CANCEL, + KEY_CLEAR, + KEY_PRIOR, + KEY_RETURN2, + KEY_SEPARATOR, + KEY_OUT, + KEY_OPER, + KEY_CLEARAGAIN, + + KEY_THOUSANDSSEPARATOR, + KEY_DECIMALSEPARATOR, + KEY_CURRENCYUNIT, + KEY_CURRENCYSUBUNIT, + + KEY_LCTRL, + KEY_LSHIFT, + KEY_LALT, + KEY_LGUI, + KEY_RCTRL, + KEY_RSHIFT, + KEY_RALT, + KEY_RGUI, + + KEY_MODE, + + KEY_AUDIONEXT, + KEY_AUDIOPREV, + KEY_AUDIOSTOP, + KEY_AUDIOPLAY, + KEY_AUDIOMUTE, + KEY_MEDIASELECT, + KEY_WWW, + KEY_MAIL, + KEY_CALCULATOR, + KEY_COMPUTER, + KEY_APP_SEARCH, + KEY_APP_HOME, + KEY_APP_BACK, + KEY_APP_FORWARD, + KEY_APP_STOP, + KEY_APP_REFRESH, + KEY_APP_BOOKMARKS, + + KEY_BRIGHTNESSDOWN, + KEY_BRIGHTNESSUP, + KEY_DISPLAYSWITCH, + KEY_KBDILLUMTOGGLE, + KEY_KBDILLUMDOWN, + KEY_KBDILLUMUP, + KEY_EJECT, + KEY_SLEEP, + + KEY_MAX_ENUM +}; + +/** +* Scancodes represent physical keys independent of the current layout. +* Their names may not match the names of the keys printed on the keyboard. +* Some of them are very esoteric... +**/ +enum Scancode +{ + SCANCODE_UNKNOWN, + + SCANCODE_A, + SCANCODE_B, + SCANCODE_C, + SCANCODE_D, + SCANCODE_E, + SCANCODE_F, + SCANCODE_G, + SCANCODE_H, + SCANCODE_I, + SCANCODE_J, + SCANCODE_K, + SCANCODE_L, + SCANCODE_M, + SCANCODE_N, + SCANCODE_O, + SCANCODE_P, + SCANCODE_Q, + SCANCODE_R, + SCANCODE_S, + SCANCODE_T, + SCANCODE_U, + SCANCODE_V, + SCANCODE_W, + SCANCODE_X, + SCANCODE_Y, + SCANCODE_Z, + + SCANCODE_1, + SCANCODE_2, + SCANCODE_3, + SCANCODE_4, + SCANCODE_5, + SCANCODE_6, + SCANCODE_7, + SCANCODE_8, + SCANCODE_9, + SCANCODE_0, + + SCANCODE_RETURN, + SCANCODE_ESCAPE, + SCANCODE_BACKSPACE, + SCANCODE_TAB, + SCANCODE_SPACE, + + SCANCODE_MINUS, + SCANCODE_EQUALS, + SCANCODE_LEFTBRACKET, + SCANCODE_RIGHTBRACKET, + SCANCODE_BACKSLASH, + SCANCODE_NONUSHASH, + SCANCODE_SEMICOLON, + SCANCODE_APOSTROPHE, + SCANCODE_GRAVE, + SCANCODE_COMMA, + SCANCODE_PERIOD, + SCANCODE_SLASH, + + SCANCODE_CAPSLOCK, + + SCANCODE_F1, + SCANCODE_F2, + SCANCODE_F3, + SCANCODE_F4, + SCANCODE_F5, + SCANCODE_F6, + SCANCODE_F7, + SCANCODE_F8, + SCANCODE_F9, + SCANCODE_F10, + SCANCODE_F11, + SCANCODE_F12, + + SCANCODE_PRINTSCREEN, + SCANCODE_SCROLLLOCK, + SCANCODE_PAUSE, + SCANCODE_INSERT, + SCANCODE_HOME, + SCANCODE_PAGEUP, + SCANCODE_DELETE, + SCANCODE_END, + SCANCODE_PAGEDOWN, + SCANCODE_RIGHT, + SCANCODE_LEFT, + SCANCODE_DOWN, + SCANCODE_UP, + + SCANCODE_NUMLOCKCLEAR, + SCANCODE_KP_DIVIDE, + SCANCODE_KP_MULTIPLY, + SCANCODE_KP_MINUS, + SCANCODE_KP_PLUS, + SCANCODE_KP_ENTER, + SCANCODE_KP_1, + SCANCODE_KP_2, + SCANCODE_KP_3, + SCANCODE_KP_4, + SCANCODE_KP_5, + SCANCODE_KP_6, + SCANCODE_KP_7, + SCANCODE_KP_8, + SCANCODE_KP_9, + SCANCODE_KP_0, + SCANCODE_KP_PERIOD, + + SCANCODE_NONUSBACKSLASH, + SCANCODE_APPLICATION, + SCANCODE_POWER, + SCANCODE_KP_EQUALS, + SCANCODE_F13, + SCANCODE_F14, + SCANCODE_F15, + SCANCODE_F16, + SCANCODE_F17, + SCANCODE_F18, + SCANCODE_F19, + SCANCODE_F20, + SCANCODE_F21, + SCANCODE_F22, + SCANCODE_F23, + SCANCODE_F24, + SCANCODE_EXECUTE, + SCANCODE_HELP, + SCANCODE_MENU, + SCANCODE_SELECT, + SCANCODE_STOP, + SCANCODE_AGAIN, + SCANCODE_UNDO, + SCANCODE_CUT, + SCANCODE_COPY, + SCANCODE_PASTE, + SCANCODE_FIND, + SCANCODE_MUTE, + SCANCODE_VOLUMEUP, + SCANCODE_VOLUMEDOWN, + SCANCODE_KP_COMMA, + SCANCODE_KP_EQUALSAS400, + + SCANCODE_INTERNATIONAL1, + SCANCODE_INTERNATIONAL2, + SCANCODE_INTERNATIONAL3, + SCANCODE_INTERNATIONAL4, + SCANCODE_INTERNATIONAL5, + SCANCODE_INTERNATIONAL6, + SCANCODE_INTERNATIONAL7, + SCANCODE_INTERNATIONAL8, + SCANCODE_INTERNATIONAL9, + SCANCODE_LANG1, + SCANCODE_LANG2, + SCANCODE_LANG3, + SCANCODE_LANG4, + SCANCODE_LANG5, + SCANCODE_LANG6, + SCANCODE_LANG7, + SCANCODE_LANG8, + SCANCODE_LANG9, + + SCANCODE_ALTERASE, + SCANCODE_SYSREQ, + SCANCODE_CANCEL, + SCANCODE_CLEAR, + SCANCODE_PRIOR, + SCANCODE_RETURN2, + SCANCODE_SEPARATOR, + SCANCODE_OUT, + SCANCODE_OPER, + SCANCODE_CLEARAGAIN, + SCANCODE_CRSEL, + SCANCODE_EXSEL, + + SCANCODE_KP_00, + SCANCODE_KP_000, + SCANCODE_THOUSANDSSEPARATOR, + SCANCODE_DECIMALSEPARATOR, + SCANCODE_CURRENCYUNIT, + SCANCODE_CURRENCYSUBUNIT, + SCANCODE_KP_LEFTPAREN, + SCANCODE_KP_RIGHTPAREN, + SCANCODE_KP_LEFTBRACE, + SCANCODE_KP_RIGHTBRACE, + SCANCODE_KP_TAB, + SCANCODE_KP_BACKSPACE, + SCANCODE_KP_A, + SCANCODE_KP_B, + SCANCODE_KP_C, + SCANCODE_KP_D, + SCANCODE_KP_E, + SCANCODE_KP_F, + SCANCODE_KP_XOR, + SCANCODE_KP_POWER, + SCANCODE_KP_PERCENT, + SCANCODE_KP_LESS, + SCANCODE_KP_GREATER, + SCANCODE_KP_AMPERSAND, + SCANCODE_KP_DBLAMPERSAND, + SCANCODE_KP_VERTICALBAR, + SCANCODE_KP_DBLVERTICALBAR, + SCANCODE_KP_COLON, + SCANCODE_KP_HASH, + SCANCODE_KP_SPACE, + SCANCODE_KP_AT, + SCANCODE_KP_EXCLAM, + SCANCODE_KP_MEMSTORE, + SCANCODE_KP_MEMRECALL, + SCANCODE_KP_MEMCLEAR, + SCANCODE_KP_MEMADD, + SCANCODE_KP_MEMSUBTRACT, + SCANCODE_KP_MEMMULTIPLY, + SCANCODE_KP_MEMDIVIDE, + SCANCODE_KP_PLUSMINUS, + SCANCODE_KP_CLEAR, + SCANCODE_KP_CLEARENTRY, + SCANCODE_KP_BINARY, + SCANCODE_KP_OCTAL, + SCANCODE_KP_DECIMAL, + SCANCODE_KP_HEXADECIMAL, + + SCANCODE_LCTRL, + SCANCODE_LSHIFT, + SCANCODE_LALT, + SCANCODE_LGUI, + SCANCODE_RCTRL, + SCANCODE_RSHIFT, + SCANCODE_RALT, + SCANCODE_RGUI, + + SCANCODE_MODE, + + SCANCODE_AUDIONEXT, + SCANCODE_AUDIOPREV, + SCANCODE_AUDIOSTOP, + SCANCODE_AUDIOPLAY, + SCANCODE_AUDIOMUTE, + SCANCODE_MEDIASELECT, + SCANCODE_WWW, + SCANCODE_MAIL, + SCANCODE_CALCULATOR, + SCANCODE_COMPUTER, + SCANCODE_AC_SEARCH, + SCANCODE_AC_HOME, + SCANCODE_AC_BACK, + SCANCODE_AC_FORWARD, + SCANCODE_AC_STOP, + SCANCODE_AC_REFRESH, + SCANCODE_AC_BOOKMARKS, + + SCANCODE_BRIGHTNESSDOWN, + SCANCODE_BRIGHTNESSUP, + SCANCODE_DISPLAYSWITCH, + SCANCODE_KBDILLUMTOGGLE, + SCANCODE_KBDILLUMDOWN, + SCANCODE_KBDILLUMUP, + SCANCODE_EJECT, + SCANCODE_SLEEP, + + SCANCODE_APP1, + SCANCODE_APP2, + + SCANCODE_MAX_ENUM +}; diff --git a/source/modules/asura-core/input/mouse.defs b/source/modules/asura-core/input/mouse.defs deleted file mode 100644 index de1d117..0000000 --- a/source/modules/asura-core/input/mouse.defs +++ /dev/null @@ -1,7 +0,0 @@ - -enum MouseButton -{ - MOUSE_BUTTON_LEFT, - MOUSE_BUTTON_MIDDLE, - MOUSE_BUTTON_RIGHT, -}; diff --git a/source/modules/asura-core/input/mouse.h b/source/modules/asura-core/input/mouse.h index 050100f..4a5a4ba 100644 --- a/source/modules/asura-core/input/mouse.h +++ b/source/modules/asura-core/input/mouse.h @@ -9,6 +9,13 @@ namespace AsuraEngine namespace Input { + enum MouseButton + { + MOUSE_BUTTON_LEFT, + MOUSE_BUTTON_MIDDLE, + MOUSE_BUTTON_RIGHT, + }; + class Mouse : public InputDevice { public: diff --git a/source/modules/asura-core/threading/thread_ex.cpp b/source/modules/asura-core/threading/thread_ex.cpp index 18b9fc7..334e58b 100644 --- a/source/modules/asura-core/threading/thread_ex.cpp +++ b/source/modules/asura-core/threading/thread_ex.cpp @@ -5,7 +5,7 @@ namespace AsuraEngine namespace Threading { - void ThreadEx::Process() + int ThreadEx::Process() { } diff --git a/source/modules/asura-core/window/window.cpp b/source/modules/asura-core/window/window.cpp deleted file mode 100644 index 83a4f53..0000000 --- a/source/modules/asura-core/window/window.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "Config.h" -#include "Window.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Window::Window(WindowStyle style) - { - } - - Window::~Window() - { - - } - - void Window::SetPosition(int x, int y) - { - ASSERT(mWindowHandle); - SDL_SetWindowPosition(mWindowHandle, x, y); - } - - void Window::SetTitle(const std::string& title) - { - - } - - void Window::Show() - { - - } - - void Window::Hide() - { - - } - - void Window::SetWindowStyle(WindowStyle style) - { - - } - - void Window::SwapRenderBuffer() - { - - } - - } -} diff --git a/source/modules/asura-core/window/window.h b/source/modules/asura-core/window/window.h deleted file mode 100644 index 052e1ee..0000000 --- a/source/modules/asura-core/window/window.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __ASURA_ENGINE_WINDOW_H__ -#define __ASURA_ENGINE_WINDOW_H__ - -#include -#include - -#include "../graphics/render_state.h" -#include "../graphics/render_target.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class WindowImpl; - - enum WindowStyle - { - WINDOW_STYLE_FULLSCREEN = 1 << 1, - }; - - /// - /// ϷĵڣrunnerֻҪһڡͬĿͻʵִ˽ӿڲֶעᵽlua༭ᵼ࣬޽ӵ༭ - /// ⴰϡ - /// - class Window - : public RenderTarget - , public AEScripting::Portable - { - public: - - LUAX_DECL_SINGLETON(Window); - - Window(WindowStyle style); - - ~Window(); - - void SetSize(uint width, uint height); - - void SetPosition(int x, int y); - - void SetTitle(const std::string& title); - - void SetWindowStyle(WindowStyle style); - - void Show(); - - void Hide(); - - /// - /// ǿ˫ĴڣҪչʾǰ̨ - /// - void SwapRenderBuffer(); - - void Clear(const Color& col = Color::Black); - - void Clear(const Math::Recti& quad, const Color& col = Color::Black); - - void Draw(const Drawable* texture, const RenderState& state); - - void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); - - protected: - - WindowImpl* mImpl; - - LUAX_DECL_METHOD(_Show); - LUAX_DECL_METHOD(_Hide); - LUAX_DECL_METHOD(_SetResolution); - LUAX_DECL_METHOD(_SetFullScreen); - LUAX_DECL_METHOD(_SetTitle); - LUAX_DECL_METHOD(_SetWindowStyle); - LUAX_DECL_METHOD(_Clear); - LUAX_DECL_METHOD(_Draw); - LUAX_DECL_METHOD(_SwapRenderBuffer); - - }; - - using RenderWindow = Window; - - ASURA_ABSTRACT class WindowImpl - { - public: - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-core/window/window_impl_glew.cpp b/source/modules/asura-core/window/window_impl_glew.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/window/window_impl_glew.h b/source/modules/asura-core/window/window_impl_glew.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/window/window_impl_glut.cpp b/source/modules/asura-core/window/window_impl_glut.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/window/window_impl_glut.h b/source/modules/asura-core/window/window_impl_glut.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/window/window_impl_sdl.cpp b/source/modules/asura-core/window/window_impl_sdl.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/window/window_impl_sdl.h b/source/modules/asura-core/window/window_impl_sdl.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-core/wnd/binding/_window.cpp b/source/modules/asura-core/wnd/binding/_window.cpp new file mode 100644 index 0000000..eb92de8 --- /dev/null +++ b/source/modules/asura-core/wnd/binding/_window.cpp @@ -0,0 +1,180 @@ +#include "../../graphics/image_data.h" + +#include "../window.h" + +using namespace std; +using namespace AEGraphics; + +namespace AsuraEngine +{ + namespace Wnd + { + + LUAX_REGISTRY(Window) + { + LUAX_REGISTER_METHODS(state, + { "Init", _Init }, + { "Exit", _Exit }, + { "Show", _Show }, + { "Hide", _Hide }, + { "SetSize", _SetSize }, + { "SetPosition", _SetPosition }, + { "SetTitle", _SetTitle }, + { "SetIcon", _SetIcon }, + { "SwapRenderBuffer", _SwapRenderBuffer }, + { "Clear", _Clear }, + { "Draw", _Draw } + ); + } + + LUAX_POSTPROCESS(Window) + { + LUAX_REGISTER_ENUM(state, "EWindowFlag", + { "FULLSCREEN", WINDOW_FULLSCREEN }, + { "OPENGL", WINDOW_OPENGL }, + { "SHOWN", WINDOW_SHOWN }, + { "HIDDEN", WINDOW_HIDDEN }, + { "BORDERLESS", WINDOW_BORDERLESS }, + { "RESIZABLE", WINDOW_RESIZABLE }, + { "MINIMIZED", WINDOW_MINIMIZED }, + { "MAXIMIZED", WINDOW_MAXIMIZED }, + { "INPUT_GRABBED", WINDOW_INPUT_GRABBED }, + { "INPUT_FOCUS", WINDOW_INPUT_FOCUS }, + { "MOUSE_FOCUS", WINDOW_MOUSE_FOCUS }, + { "ALLOW_HIGHDPI", WINDOW_ALLOW_HIGHDPI }, + { "MOUSE_CAPTURE", WINDOW_MOUSE_CAPTURE }, + { "ALWAYS_ON_TOP", WINDOW_ALWAYS_ON_TOP } + ); + + } + + // Window.Init(config_table) + LUAX_IMPL_METHOD(Window, _Init) + { + LUAX_PREPARE(L, Window); + + WindowConfig config; + + if (!state.IsType(1, LUA_TTABLE)) + return state.ErrorType(1, "window config table"); + + config.width = state.GetField(1, "width", 0); + config.height = state.GetField(1, "height", 0); + config.x = state.GetField(1, "x", 0); + config.y = state.GetField(1, "y", 0); + config.flag = state.GetField(1, "flag", WINDOW_OPENGL); + config.title = state.GetField(1, "title", ""); + config.vsync = state.GetField(1, "vsync", true); + config.show = state.GetField(1, "show", true); + + // try set window icon + state.GetField(1, "icon"); + if (state.IsType(1, LUA_TUSERDATA)) + { + ImageData* data = state.CheckUserdata(-1); + if (data) + { + data->Lock(); + config.icon = data; + Window::Get()->Init(config); + data->Unlock(); + return 0; + } + } + else + state.Pop(); + + Window::Get()->Init(config); + + return 0; + } + + // Window.Exit() + LUAX_IMPL_METHOD(Window, _Exit) + { + LUAX_PREPARE(L, Window); + Window::Get()->Exit(); + return 0; + } + + // Window.Show() + LUAX_IMPL_METHOD(Window, _Show) + { + LUAX_PREPARE(L, Window); + Window::Get()->Show(); + return 0; + } + + // Window.Hide() + LUAX_IMPL_METHOD(Window, _Hide) + { + LUAX_PREPARE(L, Window); + Window::Get()->Hide(); + return 0; + } + + // Window.SetSize(w, h) + LUAX_IMPL_METHOD(Window, _SetSize) + { + LUAX_PREPARE(L, Window); + uint w = state.CheckValue(1); + uint h = state.CheckValue(2); + Window::Get()->SetSize(w, h); + return 0; + } + + // Window.SetPosition(x, y) + LUAX_IMPL_METHOD(Window, _SetPosition) + { + LUAX_PREPARE(L, Window); + int x = state.CheckValue(1); + int y = state.CheckValue(2); + Window::Get()->SetPosition(x, y); + return 0; + } + + // Window.SetTitle(title) + LUAX_IMPL_METHOD(Window, _SetTitle) + { + LUAX_PREPARE(L, Window); + std::string title = state.CheckValue(1); + Window::Get()->SetTitle(title); + return 0; + } + + // Window.SetIcon(imageData) + LUAX_IMPL_METHOD(Window, _SetIcon) + { + LUAX_PREPARE(L, Window); + ImageData* imgData = state.CheckUserdata(1); + imgData->Lock(); + Window::Get()->SetIcon(imgData); + imgData->Unlock(); + return 0; + } + + // Window.SwapRenderBuffer() + LUAX_IMPL_METHOD(Window, _SwapRenderBuffer) + { + LUAX_PREPARE(L, Window); + Window::Get()->SwapRenderBuffer(); + return 0; + } + + // Window.Clear() + LUAX_IMPL_METHOD(Window, _Clear) + { + LUAX_PREPARE(L, Window); + Window::Get()->Clear(); + return 0; + } + + // Window.Draw() + LUAX_IMPL_METHOD(Window, _Draw) + { + LUAX_PREPARE(L, Window); + return 0; + } + + } +} \ No newline at end of file diff --git a/source/modules/asura-core/wnd/window.cpp b/source/modules/asura-core/wnd/window.cpp new file mode 100644 index 0000000..174d04e --- /dev/null +++ b/source/modules/asura-core/wnd/window.cpp @@ -0,0 +1,108 @@ +#include + +#include "window.h" + +#include "window_impl_sdl.h" +#include "window_impl_glew.h" +#include "window_impl_glut.h" + +namespace AsuraEngine +{ + namespace Wnd + { + + Window::Window() + : mImpl(nullptr) + { + } + + Window::~Window() + { + if (mImpl) + delete mImpl; + } + +#define try_init_window(impl) \ + if (!mImpl) \ + { \ + try \ + { \ + mImpl = new impl(config); \ + } \ + catch (Exception& e) \ + { \ + mImpl = nullptr; \ + } \ + } + + bool Window::Init(const WindowConfig& config) + { + ASSERT(!mImpl); +#if ASURA_WINDOW_SDL + try_init_window(WindowImplSDL); +#endif + ASSERT(mImpl); + } + + void Window::Exit() + { + if (mImpl) + delete mImpl; + } + + void Window::SetPosition(int x, int y) + { + ASSERT(mImpl); + mImpl->SetPosition(x, y); + } + + void Window::SetTitle(const std::string& title) + { + ASSERT(mImpl); + mImpl->SetTitils(title); + } + + void Window::Show() + { + ASSERT(mImpl); + mImpl->Show(); + } + + void Window::Hide() + { + ASSERT(mImpl); + mImpl->Hide(); + } + + void Window::SwapRenderBuffer() + { + ASSERT(mImpl); + mImpl->SwapRenderBuffer(); + } + + void Window::Clear(const AEGraphics::Color& col /*= AEGraphics::Color::Black*/) + { + ASSERT(mImpl); + + } + + void Window::Clear(const Math::Recti& quad, const AEGraphics::Color& col /*= AEGraphics::Color::Black*/) + { + ASSERT(mImpl); + + } + + void Window::Draw(const AEGraphics::Drawable* texture, const AEGraphics::RenderState& state) + { + ASSERT(mImpl); + + } + + void Window::Draw(const AEGraphics::Drawable* texture, const Math::Recti& quad, const AEGraphics::RenderState& state) + { + ASSERT(mImpl); + + } + + } +} diff --git a/source/modules/asura-core/wnd/window.h b/source/modules/asura-core/wnd/window.h new file mode 100644 index 0000000..1ecb934 --- /dev/null +++ b/source/modules/asura-core/wnd/window.h @@ -0,0 +1,149 @@ +#ifndef __ASURA_ENGINE_WINDOW_H__ +#define __ASURA_ENGINE_WINDOW_H__ + +#include +#include +#include + +#include "../graphics/image.h" +#include "../graphics/render_state.h" +#include "../graphics/render_target.h" + +namespace AsuraEngine +{ + namespace Wnd + { + + class WindowImpl; + + /// + /// SDLģһЩõġ + /// + enum WindowFlag + { + WINDOW_FULLSCREEN = 1 << 1, /**< fullscreen window */ + WINDOW_OPENGL = 1 << 2, /**< window usable with OpenGL context */ + WINDOW_SHOWN = 1 << 3, /**< window is visible */ + WINDOW_HIDDEN = 1 << 4, /**< window is not visible */ + WINDOW_BORDERLESS = 1 << 5, /**< no window decoration */ + WINDOW_RESIZABLE = 1 << 6, /**< window can be resized */ + WINDOW_MINIMIZED = 1 << 7, /**< window is minimized */ + WINDOW_MAXIMIZED = 1 << 8, /**< window is maximized */ + WINDOW_INPUT_GRABBED = 1 << 9, /**< window has grabbed input focus */ + WINDOW_INPUT_FOCUS = 1 << 10, /**< window has input focus */ + WINDOW_MOUSE_FOCUS = 1 << 11, /**< window has mouse focus */ + WINDOW_ALLOW_HIGHDPI = 1 << 12, /**< window should be created in high-DPI mode if supported. + On macOS NSHighResolutionCapable must be set true in the + application's Info.plist for this to have any effect. */ + WINDOW_MOUSE_CAPTURE = 1 << 13, /**< window has mouse captured (unrelated to INPUT_GRABBED) */ + WINDOW_ALWAYS_ON_TOP = 1 << 14, /**< window should always be above others */ + }; + + /// + /// Windowʼ + /// + struct WindowConfig + { + uint width, height; ///< ߴ + int x, y; ///< ڳʼ + std::string title; ///< + bool vsync; ///< ֱͬ + AEGraphics::ImageData* icon; ///< ͼ + bool show; ///< Ƿʾ + int flag; ///< ڱ + }; + + /// + /// ϷĵڣrunnerֻҪһڡͬĿͻʵִ˽ӿڲֶעᵽlua༭ + /// ᵼ࣬޽ӵ༭ⴰϡ + /// + class Window ASURA_FINAL + : public AEGraphics::RenderTarget + , public AEScripting::Portable + , public Singleton + { + public: + + /// + /// ϷʱĴΨһģ༭õࡣ + /// + LUAX_DECL_SINGLETON(Window); + + Window(); + ~Window(); + + /// + /// ڡ + /// + bool Init(const WindowConfig& config); + void Exit(); + + void SetSize(uint width, uint height); + void SetPosition(int x, int y); + void SetTitle(const std::string& title); + void SetIcon(AEGraphics::ImageData* imgData); + + void Show(); + void Hide(); + + /// + /// ǿ˫ĴڣҪչʾǰ̨ + /// + void SwapRenderBuffer(); + + void Clear(const AEGraphics::Color& col = AEGraphics::Color::Black) override; + void Clear(const Math::Recti& quad, const AEGraphics::Color& col = AEGraphics::Color::Black) override; + + void Draw(const AEGraphics::Drawable* texture, const AEGraphics::RenderState& state) override; + void Draw(const AEGraphics::Drawable* texture, const Math::Recti& quad, const AEGraphics::RenderState& state) override; + + private: + + //----------------------------------------------------------------------------// + + LUAX_DECL_ENUM(WindowFlag, 0); + + LUAX_DECL_METHOD(_Init); + LUAX_DECL_METHOD(_Exit); + LUAX_DECL_METHOD(_Show); + LUAX_DECL_METHOD(_Hide); + LUAX_DECL_METHOD(_SetSize); + LUAX_DECL_METHOD(_SetPosition); + LUAX_DECL_METHOD(_SetTitle); + LUAX_DECL_METHOD(_SetIcon); + LUAX_DECL_METHOD(_SwapRenderBuffer); + LUAX_DECL_METHOD(_Clear); + LUAX_DECL_METHOD(_Draw); + + //----------------------------------------------------------------------------// + + WindowImpl* mImpl; + + }; + + using RenderWindow = Window; + + ASURA_ABSTRACT class WindowImpl + { + public: + + WindowImpl() {}; + virtual ~WindowImpl() {}; + + virtual void SetSize(uint width, uint height) = 0; + virtual void SetPosition(int x, int y) = 0; + virtual void SetTitils(const std::string& title) = 0; + + virtual void Show(); + virtual void Hide(); + + virtual void SwapRenderBuffer() = 0; + + }; + + } +} + +namespace AEWnd = AsuraEngine::Wnd; + +#endif \ No newline at end of file diff --git a/source/modules/asura-core/wnd/window_impl_glew.cpp b/source/modules/asura-core/wnd/window_impl_glew.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/wnd/window_impl_glew.h b/source/modules/asura-core/wnd/window_impl_glew.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/wnd/window_impl_glut.cpp b/source/modules/asura-core/wnd/window_impl_glut.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/wnd/window_impl_glut.h b/source/modules/asura-core/wnd/window_impl_glut.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-core/wnd/window_impl_sdl.cpp b/source/modules/asura-core/wnd/window_impl_sdl.cpp new file mode 100644 index 0000000..bbbef9a --- /dev/null +++ b/source/modules/asura-core/wnd/window_impl_sdl.cpp @@ -0,0 +1,141 @@ +#include + +#include + +#include "window_impl_sdl.h" + +using namespace AEGraphics; + +namespace AsuraEngine +{ + namespace Wnd + { + +#define asura_flag_to_sdl_flag(flag, _flag, _sdl_flag) \ + if ((flag & _flag) != 0) \ + flag |= _sdl_flag + + WindowImplSDL::WindowImplSDL(const WindowConfig& config) + : mWnd(nullptr) + , mGLContext(0) + { + if (SDL_Init(SDL_INIT_VIDEO) < 0) + throw Exception("Cant init sdl video."); + + int flag = 0x0; + asura_flag_to_sdl_flag(flag, WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN); + asura_flag_to_sdl_flag(flag, WINDOW_OPENGL, SDL_WINDOW_OPENGL); + asura_flag_to_sdl_flag(flag, WINDOW_SHOWN, SDL_WINDOW_SHOWN); + asura_flag_to_sdl_flag(flag, WINDOW_HIDDEN, SDL_WINDOW_HIDDEN); + asura_flag_to_sdl_flag(flag, WINDOW_BORDERLESS, SDL_WINDOW_BORDERLESS); + asura_flag_to_sdl_flag(flag, WINDOW_RESIZABLE, SDL_WINDOW_RESIZABLE); + asura_flag_to_sdl_flag(flag, WINDOW_MINIMIZED, SDL_WINDOW_MINIMIZED); + asura_flag_to_sdl_flag(flag, WINDOW_MAXIMIZED, SDL_WINDOW_MAXIMIZED); + asura_flag_to_sdl_flag(flag, WINDOW_INPUT_GRABBED, SDL_WINDOW_INPUT_GRABBED); + asura_flag_to_sdl_flag(flag, WINDOW_INPUT_FOCUS, SDL_WINDOW_INPUT_FOCUS); + asura_flag_to_sdl_flag(flag, WINDOW_MOUSE_FOCUS, SDL_WINDOW_MOUSE_FOCUS); + asura_flag_to_sdl_flag(flag, WINDOW_ALLOW_HIGHDPI, SDL_WINDOW_ALLOW_HIGHDPI); + asura_flag_to_sdl_flag(flag, WINDOW_MOUSE_CAPTURE, SDL_WINDOW_MOUSE_CAPTURE); + asura_flag_to_sdl_flag(flag, WINDOW_ALWAYS_ON_TOP, SDL_WINDOW_ALWAYS_ON_TOP); + + // Set GL window / framebuffer attributes. + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0); + + mWnd = SDL_CreateWindow(config.title.c_str(), config.x, config.y, config.width, config.height, flag); + + if (!mWnd) + throw Exception("Cant create SDL window."); + + // ͼ + try + { + if (config.icon) + { + ImageData* img = config.icon; + if (img->format == COLOR_FORMAT_RGBA8) + { + SDL_Surface *surface; + + img->Lock(); + + int w = img->width, h = img->height; + surface = SDL_CreateRGBSurfaceFrom( + img->pixels, + w, h, + 32, + w * 4, + Color32::RMASK, + Color32::GMASK, + Color32::BMASK, + Color32::AMASK + ); + + img->Unlock(); + + SDL_SetWindowIcon(mWnd, surface); + SDL_FreeSurface(surface); + } + } + } catch (...) + { + } + + mGLContext = SDL_GL_CreateContext(mWnd); + + if (!mGLContext) + { + SDL_DestroyWindow(mWnd); + throw Exception("Cant create SDL GL Context."); + } + + SDL_GL_MakeCurrent(mWnd, mGLContext); + SDL_GL_SetSwapInterval(config.vsync ? 1 : 0); + } + + WindowImplSDL::~WindowImplSDL() + { + SDL_GL_DeleteContext(mGLContext); + SDL_DestroyWindow(mWnd); + SDL_FlushEvent(SDL_WINDOWEVENT); + } + + void WindowImplSDL::SetSize(uint width, uint height) + { + SDL_SetWindowSize(mWnd, width, height); + } + + void WindowImplSDL::SetPosition(int x, int y) + { + SDL_SetWindowPosition(mWnd, x, y); + } + + void WindowImplSDL::SetTitils(const std::string& title) + { + SDL_SetWindowTitle(mWnd, title.c_str()); + } + + void WindowImplSDL::Show() + { + SDL_ShowWindow(mWnd); + } + + void WindowImplSDL::Hide() + { + SDL_HideWindow(mWnd); + } + + void WindowImplSDL::SwapRenderBuffer() + { + SDL_GL_SwapWindow(mWnd); + } + + } +} \ No newline at end of file diff --git a/source/modules/asura-core/wnd/window_impl_sdl.h b/source/modules/asura-core/wnd/window_impl_sdl.h new file mode 100644 index 0000000..03e6579 --- /dev/null +++ b/source/modules/asura-core/wnd/window_impl_sdl.h @@ -0,0 +1,39 @@ +#ifndef __ASURA_WINDOW_SDL_H_ +#define __ASURA_WINDOW_SDL_H_ + +#include + +#include "window.h" + +namespace AsuraEngine +{ + namespace Wnd + { + + class WindowImplSDL ASURA_FINAL : public WindowImpl + { + public: + + WindowImplSDL(const WindowConfig& config); + ~WindowImplSDL(); + + void SetSize(uint width, uint height); + void SetPosition(int x, int y); + void SetTitils(const std::string& title); + + void Show(); + void Hide(); + + void SwapRenderBuffer(); + + private: + + SDL_Window* mWnd; + SDL_GLContext mGLContext; + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-json/json.cpp b/source/modules/asura-json/json.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-json/json.h b/source/modules/asura-json/json.h deleted file mode 100644 index 2bdaf53..0000000 --- a/source/modules/asura-json/json.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __ASURA_JSON_H__ -#define __ASURA_JSON_H__ - -namespace AsuraEngine -{ - namespace Json - { - - - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-json/json/json.cpp b/source/modules/asura-json/json/json.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-json/json/json.h b/source/modules/asura-json/json/json.h new file mode 100644 index 0000000..2bdaf53 --- /dev/null +++ b/source/modules/asura-json/json/json.h @@ -0,0 +1,14 @@ +#ifndef __ASURA_JSON_H__ +#define __ASURA_JSON_H__ + +namespace AsuraEngine +{ + namespace Json + { + + + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-network/network_module.h b/source/modules/asura-network/network_module.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio.cpp b/source/modules/asura-openal/audio.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/audio.h b/source/modules/asura-openal/audio.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/audio/audio.cpp b/source/modules/asura-openal/audio/audio.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/audio.h b/source/modules/asura-openal/audio/audio.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/mpg123_decoder.cpp b/source/modules/asura-openal/audio/mpg123_decoder.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/mpg123_decoder.h b/source/modules/asura-openal/audio/mpg123_decoder.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/sound.cpp b/source/modules/asura-openal/audio/sound.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/sound.h b/source/modules/asura-openal/audio/sound.h new file mode 100644 index 0000000..2b0eab0 --- /dev/null +++ b/source/modules/asura-openal/audio/sound.h @@ -0,0 +1,31 @@ +#ifndef __ASURA_ENGINE_SOUND_H__ +#define __ASURA_ENGINE_SOUND_H__ + +#include + +namespace AsuraEngine +{ + namespace Audio + { + + /// + /// Ƶļ + /// + class Sound ASURA_FINAL + : public AEScripting::Portable + { + public: + + Sound(); + ~Sound(); + + private: + + + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-openal/audio/sound_data.cpp b/source/modules/asura-openal/audio/sound_data.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/sound_data.h b/source/modules/asura-openal/audio/sound_data.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/sound_decode_task.cpp b/source/modules/asura-openal/audio/sound_decode_task.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/sound_decode_task.h b/source/modules/asura-openal/audio/sound_decode_task.h new file mode 100644 index 0000000..9587276 --- /dev/null +++ b/source/modules/asura-openal/audio/sound_decode_task.h @@ -0,0 +1,25 @@ +#ifndef __ASURA_OPENAL_SOUND_DECODER_TASK_H__ +#define __ASURA_OPENAL_SOUND_DECODER_TASK_H__ + +#include + +namespace AsuraEngine +{ + namespace OpenAL + { + + /// + /// Ƶļ + /// + class SoundDecodeTask : public AEThreading::ThreadTask + { + public: + + private: + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-openal/audio/sound_decoder.cpp b/source/modules/asura-openal/audio/sound_decoder.cpp new file mode 100644 index 0000000..ad9f761 --- /dev/null +++ b/source/modules/asura-openal/audio/sound_decoder.cpp @@ -0,0 +1,29 @@ +#ifndef __ASURA_ENGINE_SOUND_DECODER_H__ +#define __ASURA_ENGINE_SOUND_DECODER_H__ + +#include "Sound.h" +#include "FileSystem/DataBuffer.h" + +namespace AsuraEngine +{ + namespace Audio + { + + /// + /// Ƶļ + /// + class SoundDecoder + { + public: + + SoundDecoder(); + virtual ~SoundDecoder(); + + virtual Sound* Decode(const Filesystem::DataBuffer* db); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-openal/audio/sound_decoder.h b/source/modules/asura-openal/audio/sound_decoder.h new file mode 100644 index 0000000..e28a5a9 --- /dev/null +++ b/source/modules/asura-openal/audio/sound_decoder.h @@ -0,0 +1,30 @@ +#ifndef __ASURA_ENGINE_SOUND_DECODER_H__ +#define __ASURA_ENGINE_SOUND_DECODER_H__ + +#include + +#include "sound.h" + +namespace AsuraEngine +{ + namespace Audio + { + + /// + /// Ƶļ + /// + class SoundDecoder + { + public: + + SoundDecoder(); + virtual ~SoundDecoder(); + + virtual Sound* Decode(const AEIO::DataBuffer* db); + + }; + + } +} + +#endif \ No newline at end of file diff --git a/source/modules/asura-openal/audio/source.cpp b/source/modules/asura-openal/audio/source.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/source.h b/source/modules/asura-openal/audio/source.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/vorbis_decoder.cpp b/source/modules/asura-openal/audio/vorbis_decoder.cpp new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/audio/vorbis_decoder.h b/source/modules/asura-openal/audio/vorbis_decoder.h new file mode 100644 index 0000000..e69de29 diff --git a/source/modules/asura-openal/mpg123_decoder.cpp b/source/modules/asura-openal/mpg123_decoder.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/mpg123_decoder.h b/source/modules/asura-openal/mpg123_decoder.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/sound.cpp b/source/modules/asura-openal/sound.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/sound.h b/source/modules/asura-openal/sound.h deleted file mode 100644 index 2b0eab0..0000000 --- a/source/modules/asura-openal/sound.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __ASURA_ENGINE_SOUND_H__ -#define __ASURA_ENGINE_SOUND_H__ - -#include - -namespace AsuraEngine -{ - namespace Audio - { - - /// - /// Ƶļ - /// - class Sound ASURA_FINAL - : public AEScripting::Portable - { - public: - - Sound(); - ~Sound(); - - private: - - - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-openal/sound_data.cpp b/source/modules/asura-openal/sound_data.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/sound_data.h b/source/modules/asura-openal/sound_data.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/sound_decode_task.cpp b/source/modules/asura-openal/sound_decode_task.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/sound_decode_task.h b/source/modules/asura-openal/sound_decode_task.h deleted file mode 100644 index 9587276..0000000 --- a/source/modules/asura-openal/sound_decode_task.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __ASURA_OPENAL_SOUND_DECODER_TASK_H__ -#define __ASURA_OPENAL_SOUND_DECODER_TASK_H__ - -#include - -namespace AsuraEngine -{ - namespace OpenAL - { - - /// - /// Ƶļ - /// - class SoundDecodeTask : public AEThreading::ThreadTask - { - public: - - private: - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-openal/sound_decoder.cpp b/source/modules/asura-openal/sound_decoder.cpp deleted file mode 100644 index ad9f761..0000000 --- a/source/modules/asura-openal/sound_decoder.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __ASURA_ENGINE_SOUND_DECODER_H__ -#define __ASURA_ENGINE_SOUND_DECODER_H__ - -#include "Sound.h" -#include "FileSystem/DataBuffer.h" - -namespace AsuraEngine -{ - namespace Audio - { - - /// - /// Ƶļ - /// - class SoundDecoder - { - public: - - SoundDecoder(); - virtual ~SoundDecoder(); - - virtual Sound* Decode(const Filesystem::DataBuffer* db); - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-openal/sound_decoder.h b/source/modules/asura-openal/sound_decoder.h deleted file mode 100644 index e28a5a9..0000000 --- a/source/modules/asura-openal/sound_decoder.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __ASURA_ENGINE_SOUND_DECODER_H__ -#define __ASURA_ENGINE_SOUND_DECODER_H__ - -#include - -#include "sound.h" - -namespace AsuraEngine -{ - namespace Audio - { - - /// - /// Ƶļ - /// - class SoundDecoder - { - public: - - SoundDecoder(); - virtual ~SoundDecoder(); - - virtual Sound* Decode(const AEIO::DataBuffer* db); - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/modules/asura-openal/source.cpp b/source/modules/asura-openal/source.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/source.h b/source/modules/asura-openal/source.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/vorbis_decoder.cpp b/source/modules/asura-openal/vorbis_decoder.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-openal/vorbis_decoder.h b/source/modules/asura-openal/vorbis_decoder.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/modules/asura-utils/threading/thread_impl_posix.cpp b/source/modules/asura-utils/threading/thread_impl_posix.cpp index d2ad7af..d689353 100644 --- a/source/modules/asura-utils/threading/thread_impl_posix.cpp +++ b/source/modules/asura-utils/threading/thread_impl_posix.cpp @@ -5,5 +5,7 @@ namespace AsuraEngine namespace Threading { + + } } \ No newline at end of file diff --git a/source/modules/asura-utils/type.h b/source/modules/asura-utils/type.h index 1ed2d42..bd09bc4 100644 --- a/source/modules/asura-utils/type.h +++ b/source/modules/asura-utils/type.h @@ -80,6 +80,8 @@ namespace AsuraEngine #define ASURA_SDL_HOST 1 +#define ASURA_LITTLE_ENDIAN 1 + } // namespace AsuraEngine #endif // __ASURA_CONFIG_H__ \ No newline at end of file diff --git a/source/tests/07-image/main.cpp b/source/tests/07-image/main.cpp new file mode 100644 index 0000000..e69de29 -- cgit v1.1-26-g67d0