├── External ├── .project ├── x64 │ ├── Darwin │ │ └── GCC │ │ │ ├── include │ │ │ ├── GL │ │ │ │ ├── glew.h │ │ │ │ ├── glxew.h │ │ │ │ └── wglew.h │ │ │ └── GLFW │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ │ └── lib │ │ │ ├── libGLEW.a │ │ │ └── libglfw3.a │ └── Linux │ │ └── GCC │ │ ├── include │ │ ├── GL │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ │ └── lib │ │ ├── libGLEW.a │ │ └── libglfw3.a └── x86 │ ├── Linux │ └── GCC │ │ ├── include │ │ ├── GL │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ │ └── lib │ │ ├── libGLEW.a │ │ └── libglfw3.a │ └── Windows │ ├── MSVC │ ├── include │ │ ├── GL │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ └── lib │ │ ├── glew32s.lib │ │ └── glfw3.lib │ └── MinGW │ ├── include │ ├── GL │ │ ├── glew.h │ │ ├── glxew.h │ │ └── wglew.h │ └── GLFW │ │ ├── glfw3.h │ │ └── glfw3native.h │ └── lib │ ├── libglew32.a │ └── libglfw3.a ├── GE_Binaries ├── .project ├── COPYING.LESSER ├── CourierNew.tga ├── DevIL.dll ├── Glass.bmp ├── ILU.dll ├── LobbyCube.dds ├── Medieval_building.FBX ├── README.txt ├── RooftilesWood0005_2_S.jpg ├── RooftilesWood0005_2_Sspec.jpg ├── Skinned_Cylinder.fbx ├── SwedishRoyalCastle_negx.jpg ├── SwedishRoyalCastle_negy.jpg ├── SwedishRoyalCastle_negz.jpg ├── SwedishRoyalCastle_posx.jpg ├── SwedishRoyalCastle_posy.jpg ├── SwedishRoyalCastle_posz.jpg ├── WoodPlanksBare0002_1_S.jpg ├── WoodPlanksBare0002_1_Sspec.jpg ├── WoodRough0106_2_S.jpg ├── WoodRough0106_2_Spec.jpg ├── astroBoy_walk.fbx ├── black.jpg ├── boy_10.tga ├── cascadedshadowscene.fbx ├── crate.tga ├── default_specular.jpg ├── duckCM.tga ├── duck_triangulate.fbx ├── elephant.fbx ├── hills_negative_x.png ├── hills_negative_y.png ├── hills_negative_z.png ├── hills_positive_x.png ├── hills_positive_y.png ├── hills_positive_z.png ├── humanoid.fbx ├── monkey.fbx ├── out_0_6E339CC8.png ├── panneau_col.jpg ├── planeDiffuse.tga ├── rocks.jpg ├── rocks_NM_height.dds ├── seymourplane_triangulate.fbx ├── shadowscene.fbx ├── simplescene.fbx ├── teapot.fbx ├── uffizi_cross.dds ├── white.jpg └── yellow.jpg ├── GE_Example01 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Example02 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Example03 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Example04 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Example05 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Test01 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt ├── blender │ └── simplescene.blend └── src │ └── main.cpp ├── GE_Test02 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt ├── blender │ └── shadowscene.blend └── src │ └── main.cpp ├── GE_Test03 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt ├── blender │ └── cascadedshadowscene.blend └── src │ └── main.cpp ├── GE_Test04 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GE_Test05 ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt └── src │ └── main.cpp ├── GLUS ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── Android │ └── jni │ │ ├── Android.mk │ │ └── Application.mk ├── CMakeLists.txt ├── COPYING.LESSER ├── README.txt ├── docs │ └── Doxyfile └── src │ ├── GL │ └── glus.h │ ├── GLES2 │ └── glus2.h │ ├── GLES3 │ ├── glus3.h │ └── glus31.h │ ├── GLUS │ ├── glus_axisalignedbox.h │ ├── glus_clib.h │ ├── glus_complex.h │ ├── glus_define.h │ ├── glus_define_color.h │ ├── glus_define_color_channel.h │ ├── glus_define_color_channel_es.h │ ├── glus_define_color_channel_vg.h │ ├── glus_define_color_vg.h │ ├── glus_define_shader.h │ ├── glus_define_shader_es.h │ ├── glus_define_shader_es31.h │ ├── glus_define_uint.h │ ├── glus_define_ushort.h │ ├── glus_egl.h │ ├── glus_extension.h │ ├── glus_file.h │ ├── glus_file_binary.h │ ├── glus_file_text.h │ ├── glus_fourier.h │ ├── glus_function.h │ ├── glus_glfw_es.h │ ├── glus_image.h │ ├── glus_image_hdr.h │ ├── glus_image_pkm.h │ ├── glus_image_tga.h │ ├── glus_intersect.h │ ├── glus_line.h │ ├── glus_line_wavefront.h │ ├── glus_log.h │ ├── glus_math.h │ ├── glus_matrix.h │ ├── glus_matrix_planar.h │ ├── glus_matrix_viewprojection.h │ ├── glus_memory.h │ ├── glus_orientedbox.h │ ├── glus_padding.h │ ├── glus_perlin.h │ ├── glus_plane.h │ ├── glus_point.h │ ├── glus_profile.h │ ├── glus_program.h │ ├── glus_program_es.h │ ├── glus_program_es31.h │ ├── glus_programpipeline.h │ ├── glus_programpipeline_es31.h │ ├── glus_quaternion.h │ ├── glus_random.h │ ├── glus_raytrace.h │ ├── glus_screenshot.h │ ├── glus_shape.h │ ├── glus_shape_adjacency.h │ ├── glus_shape_texgen.h │ ├── glus_shape_wavefront.h │ ├── glus_sphere.h │ ├── glus_time.h │ ├── glus_typedef.h │ ├── glus_vector.h │ ├── glus_version.h │ ├── glus_wavefront.h │ └── glus_window.h │ ├── VG │ └── glus.h │ ├── glus_axisalignedbox.c │ ├── glus_complex.c │ ├── glus_egl_es.c │ ├── glus_extension.c │ ├── glus_extension_vg.c │ ├── glus_file.c │ ├── glus_file_binary.c │ ├── glus_file_text.c │ ├── glus_fourier.c │ ├── glus_image.c │ ├── glus_image_hdr.c │ ├── glus_image_pkm.c │ ├── glus_image_tga.c │ ├── glus_intersect.c │ ├── glus_line.c │ ├── glus_line_wavefront.c │ ├── glus_log.c │ ├── glus_log_vg.c │ ├── glus_math.c │ ├── glus_matrix.c │ ├── glus_matrix_planar.c │ ├── glus_matrix_viewprojection.c │ ├── glus_memory.c │ ├── glus_memory_nodm.c │ ├── glus_orientedbox.c │ ├── glus_os_android_es.c │ ├── glus_os_linux_es.c │ ├── glus_os_linux_imx6_es.c │ ├── glus_os_linux_raspberrypi_es.c │ ├── glus_os_windows_es.c │ ├── glus_padding.c │ ├── glus_perlin.c │ ├── glus_plane.c │ ├── glus_point.c │ ├── glus_profile.c │ ├── glus_program.c │ ├── glus_program_es.c │ ├── glus_program_es31.c │ ├── glus_programpipeline.c │ ├── glus_programpipeline_es31.c │ ├── glus_quaternion.c │ ├── glus_random.c │ ├── glus_raytrace.c │ ├── glus_screenshot.c │ ├── glus_screenshot_vg.c │ ├── glus_shape.c │ ├── glus_shape_adjacency.c │ ├── glus_shape_texgen.c │ ├── glus_shape_wavefront.c │ ├── glus_sphere.c │ ├── glus_time.c │ ├── glus_time_es.c │ ├── glus_vector.c │ ├── glus_version.c │ ├── glus_wavefront.c │ ├── glus_window_egl_es.c │ ├── glus_window_glfw.c │ └── glus_window_recording.c ├── GraphicsEngine ├── .cproject ├── .gitignore ├── .project ├── .settings │ ├── language.settings.xml │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── CMakeLists.txt ├── COPYING.LESSER ├── README.txt ├── shader │ ├── Debug.frag.glsl │ ├── Debug.vert.glsl │ ├── Font.frag.glsl │ ├── Font.vert.glsl │ ├── Ground.cont.glsl │ ├── Ground.eval.glsl │ ├── Ground.geom.glsl │ ├── Ground.vert.glsl │ ├── GroundToCubeMap.geom.glsl │ ├── LineGeometry.frag.glsl │ ├── LineGeometry.vert.glsl │ ├── LineGeometryLines.vert.glsl │ ├── Phong.frag.glsl │ ├── Phong.vert.glsl │ ├── PhongToCubeMap.geom.glsl │ ├── PhongToCubeMap.vert.glsl │ ├── PostProcess.frag.glsl │ ├── PostProcess.vert.glsl │ ├── Red.frag.glsl │ ├── Sky.frag.glsl │ └── Sky.vert.glsl ├── src │ ├── GraphicsEngine.cpp │ ├── GraphicsEngine.h │ ├── UsedLibs.h │ ├── layer0 │ │ ├── algorithm │ │ │ ├── Quicksort.h │ │ │ └── QuicksortPointer.h │ │ ├── color │ │ │ ├── Color.cpp │ │ │ └── Color.h │ │ ├── concurrency │ │ │ ├── ThreadSafeCounter.cpp │ │ │ ├── ThreadSafeCounter.h │ │ │ └── ThreadsafeQueue.h │ │ ├── filter │ │ │ ├── GaussFilter.cpp │ │ │ └── GaussFilter.h │ │ ├── json │ │ │ ├── JSONarray.cpp │ │ │ ├── JSONarray.h │ │ │ ├── JSONdecoder.cpp │ │ │ ├── JSONdecoder.h │ │ │ ├── JSONencoder.cpp │ │ │ ├── JSONencoder.h │ │ │ ├── JSONfalse.cpp │ │ │ ├── JSONfalse.h │ │ │ ├── JSONnull.cpp │ │ │ ├── JSONnull.h │ │ │ ├── JSONnumber.cpp │ │ │ ├── JSONnumber.h │ │ │ ├── JSONobject.cpp │ │ │ ├── JSONobject.h │ │ │ ├── JSONstring.cpp │ │ │ ├── JSONstring.h │ │ │ ├── JSONtokens.h │ │ │ ├── JSONtrue.cpp │ │ │ ├── JSONtrue.h │ │ │ ├── JSONvalue.cpp │ │ │ └── JSONvalue.h │ │ ├── math │ │ │ ├── AxisAlignedBox.cpp │ │ │ ├── AxisAlignedBox.h │ │ │ ├── Line.cpp │ │ │ ├── Line.h │ │ │ ├── Matrix3x3.cpp │ │ │ ├── Matrix3x3.h │ │ │ ├── Matrix4x4.cpp │ │ │ ├── Matrix4x4.h │ │ │ ├── Plane.cpp │ │ │ ├── Plane.h │ │ │ ├── Point4.cpp │ │ │ ├── Point4.h │ │ │ ├── Quaternion.cpp │ │ │ ├── Quaternion.h │ │ │ ├── Sphere.cpp │ │ │ ├── Sphere.h │ │ │ ├── Vector3.cpp │ │ │ └── Vector3.h │ │ ├── noise │ │ │ ├── PerlinNoise.cpp │ │ │ ├── PerlinNoise.h │ │ │ ├── PerlinNoise1D.cpp │ │ │ ├── PerlinNoise1D.h │ │ │ ├── PerlinNoise2D.cpp │ │ │ ├── PerlinNoise2D.h │ │ │ ├── PerlinNoise3D.cpp │ │ │ └── PerlinNoise3D.h │ │ ├── os │ │ │ ├── Directory.h │ │ │ ├── Directory_Linux.cpp │ │ │ └── Directory_Windows.cpp │ │ ├── primitive │ │ │ ├── ConeShape.cpp │ │ │ ├── ConeShape.h │ │ │ ├── CubeShape.cpp │ │ │ ├── CubeShape.h │ │ │ ├── CylinderShape.cpp │ │ │ ├── CylinderShape.h │ │ │ ├── DomeShape.cpp │ │ │ ├── DomeShape.h │ │ │ ├── GridPlaneShape.cpp │ │ │ ├── GridPlaneShape.h │ │ │ ├── Shape.cpp │ │ │ ├── Shape.h │ │ │ ├── SphereShape.cpp │ │ │ ├── SphereShape.h │ │ │ ├── TorusShape.cpp │ │ │ └── TorusShape.h │ │ ├── statistic │ │ │ ├── FrameCounter.cpp │ │ │ └── FrameCounter.h │ │ ├── stereotype │ │ │ ├── KeyValueMap.h │ │ │ ├── Singleton.h │ │ │ └── ValueVector.h │ │ └── stl │ │ │ └── Helper.h │ ├── layer1 │ │ ├── collision │ │ │ ├── AxisAlignedBoundingBox.cpp │ │ │ ├── AxisAlignedBoundingBox.h │ │ │ ├── BoundingSphere.cpp │ │ │ └── BoundingSphere.h │ │ ├── command │ │ │ ├── Command.h │ │ │ ├── StopCommand.cpp │ │ │ ├── StopCommand.h │ │ │ ├── Worker.cpp │ │ │ ├── Worker.h │ │ │ ├── WorkerManager.cpp │ │ │ └── WorkerManager.h │ │ ├── event │ │ │ ├── Event.cpp │ │ │ ├── Event.h │ │ │ ├── EventManager.cpp │ │ │ ├── EventManager.h │ │ │ └── EventReceiver.h │ │ ├── renderbuffer │ │ │ ├── RenderBuffer.cpp │ │ │ ├── RenderBuffer.h │ │ │ ├── RenderBufferFactory.cpp │ │ │ ├── RenderBufferFactory.h │ │ │ ├── RenderBufferManager.cpp │ │ │ ├── RenderBufferManager.h │ │ │ ├── RenderBufferMultisample.cpp │ │ │ ├── RenderBufferMultisample.h │ │ │ ├── RenderBufferMultisampleManager.cpp │ │ │ └── RenderBufferMultisampleManager.h │ │ ├── shader │ │ │ ├── Program.cpp │ │ │ ├── Program.h │ │ │ ├── ProgramFactory.cpp │ │ │ ├── ProgramFactory.h │ │ │ ├── ProgramManager.cpp │ │ │ ├── ProgramManager.h │ │ │ ├── ProgramPipeline.cpp │ │ │ ├── ProgramPipeline.h │ │ │ ├── ProgramPipelineManager.cpp │ │ │ ├── ProgramPipelineManager.h │ │ │ ├── ProgramSeparable.cpp │ │ │ ├── ProgramSeparable.h │ │ │ ├── ProgramSeparableManager.cpp │ │ │ ├── ProgramSeparableManager.h │ │ │ ├── VAO.cpp │ │ │ ├── VAO.h │ │ │ └── Variables.h │ │ └── texture │ │ │ ├── PixelData.cpp │ │ │ ├── PixelData.h │ │ │ ├── Texture.cpp │ │ │ ├── Texture.h │ │ │ ├── Texture1D.cpp │ │ │ ├── Texture1D.h │ │ │ ├── Texture1DArray.cpp │ │ │ ├── Texture1DArray.h │ │ │ ├── Texture1DArrayManager.cpp │ │ │ ├── Texture1DArrayManager.h │ │ │ ├── Texture1DManager.cpp │ │ │ ├── Texture1DManager.h │ │ │ ├── Texture2D.cpp │ │ │ ├── Texture2D.h │ │ │ ├── Texture2DArray.cpp │ │ │ ├── Texture2DArray.h │ │ │ ├── Texture2DArrayManager.cpp │ │ │ ├── Texture2DArrayManager.h │ │ │ ├── Texture2DManager.cpp │ │ │ ├── Texture2DManager.h │ │ │ ├── Texture2DMultisample.cpp │ │ │ ├── Texture2DMultisample.h │ │ │ ├── Texture2DMultisampleManager.cpp │ │ │ ├── Texture2DMultisampleManager.h │ │ │ ├── TextureCubeMap.cpp │ │ │ ├── TextureCubeMap.h │ │ │ ├── TextureCubeMapArray.cpp │ │ │ ├── TextureCubeMapArray.h │ │ │ ├── TextureCubeMapArrayManager.cpp │ │ │ ├── TextureCubeMapArrayManager.h │ │ │ ├── TextureCubeMapManager.cpp │ │ │ ├── TextureCubeMapManager.h │ │ │ ├── TextureFactory.h │ │ │ ├── TextureFactoryBase.cpp │ │ │ ├── TextureFactoryBase.h │ │ │ ├── TextureFactory_DevIL.cpp │ │ │ ├── TextureFactory_DevIL.h │ │ │ ├── TextureFactory_GLUS.cpp │ │ │ ├── TextureFactory_GLUS.h │ │ │ ├── TextureStandard.cpp │ │ │ └── TextureStandard.h │ ├── layer2 │ │ ├── debug │ │ │ ├── DebugDraw.cpp │ │ │ ├── DebugDraw.h │ │ │ ├── DebugDrawFactory.cpp │ │ │ ├── DebugDrawFactory.h │ │ │ ├── GroundPlane.cpp │ │ │ ├── GroundPlane.h │ │ │ ├── LineGeometry.cpp │ │ │ ├── LineGeometry.h │ │ │ ├── LineGeometryManager.cpp │ │ │ ├── LineGeometryManager.h │ │ │ ├── LineGeometryVAO.cpp │ │ │ └── LineGeometryVAO.h │ │ ├── environment │ │ │ ├── Sky.cpp │ │ │ ├── Sky.h │ │ │ ├── SkyDome.cpp │ │ │ ├── SkyDome.h │ │ │ ├── SkyManager.cpp │ │ │ ├── SkyManager.h │ │ │ ├── SkySphere.cpp │ │ │ ├── SkySphere.h │ │ │ ├── SkyVAO.cpp │ │ │ └── SkyVAO.h │ │ ├── framebuffer │ │ │ ├── FrameBuffer.cpp │ │ │ ├── FrameBuffer.h │ │ │ ├── FrameBuffer2D.cpp │ │ │ ├── FrameBuffer2D.h │ │ │ ├── FrameBuffer2DManager.cpp │ │ │ ├── FrameBuffer2DManager.h │ │ │ ├── FrameBuffer2DMultisample.cpp │ │ │ ├── FrameBuffer2DMultisample.h │ │ │ ├── FrameBuffer2DMultisampleManager.cpp │ │ │ ├── FrameBuffer2DMultisampleManager.h │ │ │ ├── FrameBufferBase.cpp │ │ │ ├── FrameBufferBase.h │ │ │ ├── FrameBufferCubeMap.cpp │ │ │ ├── FrameBufferCubeMap.h │ │ │ ├── FrameBufferCubeMapManager.cpp │ │ │ └── FrameBufferCubeMapManager.h │ │ ├── ground │ │ │ ├── Ground.cpp │ │ │ ├── Ground.h │ │ │ ├── GroundFactory.cpp │ │ │ ├── GroundFactory.h │ │ │ ├── GroundManager.cpp │ │ │ ├── GroundManager.h │ │ │ ├── GroundVAO.cpp │ │ │ └── GroundVAO.h │ │ ├── interpolation │ │ │ ├── ConstantInterpolator.cpp │ │ │ ├── ConstantInterpolator.h │ │ │ ├── CubicInterpolator.cpp │ │ │ ├── CubicInterpolator.h │ │ │ ├── Interpolator.h │ │ │ ├── LinearInterpolator.cpp │ │ │ └── LinearInterpolator.h │ │ └── material │ │ │ ├── RefractiveIndices.h │ │ │ ├── SurfaceMaterial.cpp │ │ │ ├── SurfaceMaterial.h │ │ │ ├── SurfaceMaterialFactory.cpp │ │ │ └── SurfaceMaterialFactory.h │ ├── layer3 │ │ ├── animation │ │ │ ├── AnimationLayer.cpp │ │ │ ├── AnimationLayer.h │ │ │ ├── AnimationStack.cpp │ │ │ └── AnimationStack.h │ │ ├── camera │ │ │ ├── Camera.cpp │ │ │ ├── Camera.h │ │ │ ├── CameraManager.cpp │ │ │ ├── CameraManager.h │ │ │ ├── OrthographicCamera.cpp │ │ │ ├── OrthographicCamera.h │ │ │ ├── PerspectiveCamera.cpp │ │ │ ├── PerspectiveCamera.h │ │ │ ├── ViewFrustum.cpp │ │ │ ├── ViewFrustum.h │ │ │ ├── Viewport.cpp │ │ │ ├── Viewport.h │ │ │ ├── ViewportManager.cpp │ │ │ └── ViewportManager.h │ │ ├── light │ │ │ ├── DirectionalLight.cpp │ │ │ ├── DirectionalLight.h │ │ │ ├── Light.cpp │ │ │ ├── Light.h │ │ │ ├── LightManager.cpp │ │ │ ├── LightManager.h │ │ │ ├── PointLight.cpp │ │ │ ├── PointLight.h │ │ │ ├── SpotLight.cpp │ │ │ └── SpotLight.h │ │ ├── mesh │ │ │ ├── Mesh.cpp │ │ │ ├── Mesh.h │ │ │ ├── MeshFactory.cpp │ │ │ ├── MeshFactory.h │ │ │ ├── SubMesh.cpp │ │ │ ├── SubMesh.h │ │ │ ├── SubMeshVAO.cpp │ │ │ └── SubMeshVAO.h │ │ └── shadow │ │ │ ├── ShadowMap2D.cpp │ │ │ └── ShadowMap2D.h │ ├── layer4 │ │ ├── entity │ │ │ ├── Entity.cpp │ │ │ ├── Entity.h │ │ │ ├── EntityList.cpp │ │ │ └── EntityList.h │ │ ├── font │ │ │ ├── Font.cpp │ │ │ ├── Font.h │ │ │ ├── FontFactory.cpp │ │ │ ├── FontFactory.h │ │ │ ├── FontManager.cpp │ │ │ ├── FontManager.h │ │ │ ├── FontVAO.cpp │ │ │ └── FontVAO.h │ │ ├── input │ │ │ ├── User.cpp │ │ │ └── User.h │ │ ├── postprocess │ │ │ ├── PostProcessor.cpp │ │ │ ├── PostProcessor.h │ │ │ ├── PostProcessor2D.cpp │ │ │ ├── PostProcessor2D.h │ │ │ ├── PostProcessor2DManager.cpp │ │ │ ├── PostProcessor2DManager.h │ │ │ ├── PostProcessor2DMultisample.cpp │ │ │ ├── PostProcessor2DMultisample.h │ │ │ ├── PostProcessor2DMultisampleManager.cpp │ │ │ ├── PostProcessor2DMultisampleManager.h │ │ │ ├── PostProcessorVAO.cpp │ │ │ └── PostProcessorVAO.h │ │ ├── shader │ │ │ ├── ProgramManagerProxy.cpp │ │ │ └── ProgramManagerProxy.h │ │ └── shadow │ │ │ ├── OrthographicCameraCascadedShadowMap2D.cpp │ │ │ ├── OrthographicCameraCascadedShadowMap2D.h │ │ │ ├── OrthographicCameraShadowMap2D.cpp │ │ │ └── OrthographicCameraShadowMap2D.h │ ├── layer5 │ │ ├── command │ │ │ ├── EntityCommandManager.cpp │ │ │ ├── EntityCommandManager.h │ │ │ ├── UpdateCommand.cpp │ │ │ └── UpdateCommand.h │ │ ├── debug │ │ │ ├── FpsPrinter.cpp │ │ │ └── FpsPrinter.h │ │ ├── environment │ │ │ ├── DynamicEnvironment.cpp │ │ │ ├── DynamicEnvironment.h │ │ │ ├── DynamicEnvironmentManager.cpp │ │ │ └── DynamicEnvironmentManager.h │ │ └── node │ │ │ ├── InstanceNode.cpp │ │ │ ├── InstanceNode.h │ │ │ ├── Node.cpp │ │ │ ├── Node.h │ │ │ ├── NodeOwner.h │ │ │ ├── NodeTreeFactory.cpp │ │ │ └── NodeTreeFactory.h │ ├── layer6 │ │ ├── model │ │ │ ├── Model.cpp │ │ │ ├── Model.h │ │ │ ├── ModelFactory.cpp │ │ │ ├── ModelFactory.h │ │ │ ├── ModelManager.cpp │ │ │ └── ModelManager.h │ │ └── octree │ │ │ ├── Octant.cpp │ │ │ ├── Octant.h │ │ │ ├── Octree.cpp │ │ │ ├── Octree.h │ │ │ ├── OctreeEntity.cpp │ │ │ ├── OctreeEntity.h │ │ │ ├── OctreeFactory.cpp │ │ │ └── OctreeFactory.h │ ├── layer7 │ │ └── entity │ │ │ ├── GeneralEntity.cpp │ │ │ ├── GeneralEntity.h │ │ │ ├── GeneralEntityManager.cpp │ │ │ └── GeneralEntityManager.h │ ├── layer8 │ │ ├── groundentity │ │ │ ├── GroundEntity.cpp │ │ │ └── GroundEntity.h │ │ ├── modelentity │ │ │ ├── ModelEntity.cpp │ │ │ └── ModelEntity.h │ │ └── path │ │ │ ├── CirclePath.cpp │ │ │ ├── CirclePath.h │ │ │ ├── LinePath.cpp │ │ │ ├── LinePath.h │ │ │ ├── OrientedCirclePath.cpp │ │ │ ├── OrientedCirclePath.h │ │ │ ├── OrientedLinePath.cpp │ │ │ ├── OrientedLinePath.h │ │ │ ├── Path.cpp │ │ │ ├── Path.h │ │ │ ├── PathEntityManager.cpp │ │ │ └── PathEntityManager.h │ └── layer9 │ │ ├── camerafactory │ │ ├── CameraEntityFactory.cpp │ │ └── CameraEntityFactory.h │ │ ├── fbxfactory │ │ ├── FbxEntityFactory.cpp │ │ ├── FbxEntityFactory.h │ │ ├── FbxSubMesh.cpp │ │ └── FbxSubMesh.h │ │ ├── gltffactory │ │ ├── GlTfAccessor.cpp │ │ ├── GlTfAccessor.h │ │ ├── GlTfAnimation.cpp │ │ ├── GlTfAnimation.h │ │ ├── GlTfBin.cpp │ │ ├── GlTfBin.h │ │ ├── GlTfBufferView.cpp │ │ ├── GlTfBufferView.h │ │ ├── GlTfChannel.cpp │ │ ├── GlTfChannel.h │ │ ├── GlTfEntityDecoderFactory.cpp │ │ ├── GlTfEntityDecoderFactory.h │ │ ├── GlTfEntityEncoderFactory.cpp │ │ ├── GlTfEntityEncoderFactory.h │ │ ├── GlTfInstanceSkin.cpp │ │ ├── GlTfInstanceSkin.h │ │ ├── GlTfMesh.cpp │ │ ├── GlTfMesh.h │ │ ├── GlTfNode.cpp │ │ ├── GlTfNode.h │ │ ├── GlTfPrimitive.cpp │ │ ├── GlTfPrimitive.h │ │ ├── GlTfSampler.cpp │ │ ├── GlTfSampler.h │ │ ├── GlTfSkin.cpp │ │ └── GlTfSkin.h │ │ ├── groundfactory │ │ ├── GroundEntityFactory.cpp │ │ └── GroundEntityFactory.h │ │ ├── lightfactory │ │ ├── LightEntityFactory.cpp │ │ └── LightEntityFactory.h │ │ └── primitivefactory │ │ ├── PrimitiveEntityFactory.cpp │ │ └── PrimitiveEntityFactory.h └── uml │ └── design.uxf └── README.md /External/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | External 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /External/x64/Darwin/GCC/lib/libGLEW.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x64/Darwin/GCC/lib/libGLEW.a -------------------------------------------------------------------------------- /External/x64/Darwin/GCC/lib/libglfw3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x64/Darwin/GCC/lib/libglfw3.a -------------------------------------------------------------------------------- /External/x64/Linux/GCC/lib/libGLEW.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x64/Linux/GCC/lib/libGLEW.a -------------------------------------------------------------------------------- /External/x64/Linux/GCC/lib/libglfw3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x64/Linux/GCC/lib/libglfw3.a -------------------------------------------------------------------------------- /External/x86/Linux/GCC/lib/libGLEW.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Linux/GCC/lib/libGLEW.a -------------------------------------------------------------------------------- /External/x86/Linux/GCC/lib/libglfw3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Linux/GCC/lib/libglfw3.a -------------------------------------------------------------------------------- /External/x86/Windows/MSVC/lib/glew32s.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Windows/MSVC/lib/glew32s.lib -------------------------------------------------------------------------------- /External/x86/Windows/MSVC/lib/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Windows/MSVC/lib/glfw3.lib -------------------------------------------------------------------------------- /External/x86/Windows/MinGW/lib/libglew32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Windows/MinGW/lib/libglew32.a -------------------------------------------------------------------------------- /External/x86/Windows/MinGW/lib/libglfw3.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/External/x86/Windows/MinGW/lib/libglfw3.a -------------------------------------------------------------------------------- /GE_Binaries/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | GE_Binaries 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /GE_Binaries/CourierNew.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/CourierNew.tga -------------------------------------------------------------------------------- /GE_Binaries/DevIL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/DevIL.dll -------------------------------------------------------------------------------- /GE_Binaries/Glass.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/Glass.bmp -------------------------------------------------------------------------------- /GE_Binaries/ILU.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/ILU.dll -------------------------------------------------------------------------------- /GE_Binaries/LobbyCube.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/LobbyCube.dds -------------------------------------------------------------------------------- /GE_Binaries/Medieval_building.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/Medieval_building.FBX -------------------------------------------------------------------------------- /GE_Binaries/README.txt: -------------------------------------------------------------------------------- 1 | OpenGL 4 Graphics Engine examples: 2 | ---------------------------------- 3 | 4 | Important: 5 | 6 | - Please copy the humanoid.fbx file from the FBX SDK to the GE_Binaries folder. 7 | It is located in the ViewScene example folder. 8 | Otherwise the example will not run. 9 | 10 | Further information: 11 | 12 | - README.txt of GraphicsEngine 13 | - README.txt of GLUS 14 | -------------------------------------------------------------------------------- /GE_Binaries/RooftilesWood0005_2_S.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/RooftilesWood0005_2_S.jpg -------------------------------------------------------------------------------- /GE_Binaries/RooftilesWood0005_2_Sspec.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/RooftilesWood0005_2_Sspec.jpg -------------------------------------------------------------------------------- /GE_Binaries/Skinned_Cylinder.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/Skinned_Cylinder.fbx -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_negx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_negx.jpg -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_negy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_negy.jpg -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_negz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_negz.jpg -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_posx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_posx.jpg -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_posy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_posy.jpg -------------------------------------------------------------------------------- /GE_Binaries/SwedishRoyalCastle_posz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/SwedishRoyalCastle_posz.jpg -------------------------------------------------------------------------------- /GE_Binaries/WoodPlanksBare0002_1_S.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/WoodPlanksBare0002_1_S.jpg -------------------------------------------------------------------------------- /GE_Binaries/WoodPlanksBare0002_1_Sspec.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/WoodPlanksBare0002_1_Sspec.jpg -------------------------------------------------------------------------------- /GE_Binaries/WoodRough0106_2_S.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/WoodRough0106_2_S.jpg -------------------------------------------------------------------------------- /GE_Binaries/WoodRough0106_2_Spec.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/WoodRough0106_2_Spec.jpg -------------------------------------------------------------------------------- /GE_Binaries/astroBoy_walk.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/astroBoy_walk.fbx -------------------------------------------------------------------------------- /GE_Binaries/black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/black.jpg -------------------------------------------------------------------------------- /GE_Binaries/boy_10.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/boy_10.tga -------------------------------------------------------------------------------- /GE_Binaries/crate.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/crate.tga -------------------------------------------------------------------------------- /GE_Binaries/default_specular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/default_specular.jpg -------------------------------------------------------------------------------- /GE_Binaries/duckCM.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/duckCM.tga -------------------------------------------------------------------------------- /GE_Binaries/duck_triangulate.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/duck_triangulate.fbx -------------------------------------------------------------------------------- /GE_Binaries/elephant.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/elephant.fbx -------------------------------------------------------------------------------- /GE_Binaries/hills_negative_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_negative_x.png -------------------------------------------------------------------------------- /GE_Binaries/hills_negative_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_negative_y.png -------------------------------------------------------------------------------- /GE_Binaries/hills_negative_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_negative_z.png -------------------------------------------------------------------------------- /GE_Binaries/hills_positive_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_positive_x.png -------------------------------------------------------------------------------- /GE_Binaries/hills_positive_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_positive_y.png -------------------------------------------------------------------------------- /GE_Binaries/hills_positive_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/hills_positive_z.png -------------------------------------------------------------------------------- /GE_Binaries/humanoid.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/humanoid.fbx -------------------------------------------------------------------------------- /GE_Binaries/monkey.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/monkey.fbx -------------------------------------------------------------------------------- /GE_Binaries/out_0_6E339CC8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/out_0_6E339CC8.png -------------------------------------------------------------------------------- /GE_Binaries/panneau_col.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/panneau_col.jpg -------------------------------------------------------------------------------- /GE_Binaries/planeDiffuse.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/planeDiffuse.tga -------------------------------------------------------------------------------- /GE_Binaries/rocks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/rocks.jpg -------------------------------------------------------------------------------- /GE_Binaries/rocks_NM_height.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/rocks_NM_height.dds -------------------------------------------------------------------------------- /GE_Binaries/seymourplane_triangulate.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/seymourplane_triangulate.fbx -------------------------------------------------------------------------------- /GE_Binaries/teapot.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/teapot.fbx -------------------------------------------------------------------------------- /GE_Binaries/uffizi_cross.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/uffizi_cross.dds -------------------------------------------------------------------------------- /GE_Binaries/white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/white.jpg -------------------------------------------------------------------------------- /GE_Binaries/yellow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Binaries/yellow.jpg -------------------------------------------------------------------------------- /GE_Example01/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Example01/.gitignore -------------------------------------------------------------------------------- /GE_Example01/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Example02/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Example02/.gitignore -------------------------------------------------------------------------------- /GE_Example02/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Example03/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Example03/.gitignore -------------------------------------------------------------------------------- /GE_Example03/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Example04/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Example04/.gitignore -------------------------------------------------------------------------------- /GE_Example04/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Example05/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Example05/.gitignore -------------------------------------------------------------------------------- /GE_Example05/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Test01/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test01/.gitignore -------------------------------------------------------------------------------- /GE_Test01/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Test01/blender/simplescene.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test01/blender/simplescene.blend -------------------------------------------------------------------------------- /GE_Test02/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test02/.gitignore -------------------------------------------------------------------------------- /GE_Test02/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Test02/blender/shadowscene.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test02/blender/shadowscene.blend -------------------------------------------------------------------------------- /GE_Test03/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test03/.gitignore -------------------------------------------------------------------------------- /GE_Test03/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Test03/blender/cascadedshadowscene.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/McNopper/GraphicsEngine/3f956a4452bd2a8c1cdc414d27a0bc745f623925/GE_Test03/blender/cascadedshadowscene.blend -------------------------------------------------------------------------------- /GE_Test04/.gitignore: -------------------------------------------------------------------------------- 1 | /x64__Linux__GCC_Debug 2 | -------------------------------------------------------------------------------- /GE_Test04/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GE_Test05/.gitignore: -------------------------------------------------------------------------------- 1 | /x64__Linux__GCC_Debug 2 | -------------------------------------------------------------------------------- /GE_Test05/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GLUS/.gitignore: -------------------------------------------------------------------------------- 1 | /ARMv7_Vivante_Linux_GLES3_GCC_Release 2 | /ARMv7_Vivante_Linux_VG11_GCC_Release 3 | /x86_PowerVR_Windows_GLES3_MinGW_Debug/ 4 | /x86__Windows__MinGW_Debug/ 5 | /x86_Khronos_Windows_VG11_MinGW_Debug/ 6 | /x86_PowerVR_Windows_GLES2_MinGW_Debug/ 7 | /x86_PowerVR_Windows_GLES31_MinGW_Debug/ 8 | /ARMv7_Vivante_Linux_GLES2_GCC_Release/ 9 | -------------------------------------------------------------------------------- /GLUS/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := android-19 2 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_clib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_CLIB_H_ 19 | #define GLUS_CLIB_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #endif /* GLUS_CLIB_H_ */ 30 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_COLOR_H_ 19 | #define GLUS_DEFINE_COLOR_H_ 20 | 21 | #define GLUS_RED 0x00001903 22 | #define GLUS_ALPHA 0x00001906 23 | #define GLUS_RGB 0x00001907 24 | #define GLUS_RGBA 0x00001908 25 | #define GLUS_LUMINANCE 0x00001909 26 | 27 | #endif /* GLUS_DEFINE_COLOR_H_ */ 28 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_color_channel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_COLOR_CHANNEL_H_ 19 | #define GLUS_DEFINE_COLOR_CHANNEL_H_ 20 | 21 | #define GLUS_SINGLE_CHANNEL GLUS_RED 22 | 23 | #endif /* GLUS_DEFINE_COLOR_CHANNEL_H_ */ 24 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_color_channel_es.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_COLOR_CHANNEL_ES_H_ 19 | #define GLUS_DEFINE_COLOR_CHANNEL_ES_H_ 20 | 21 | #define GLUS_SINGLE_CHANNEL GLUS_ALPHA 22 | 23 | #endif /* GLUS_DEFINE_COLOR_CHANNEL_ES_H_ */ 24 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_color_channel_vg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_COLOR_CHANNEL_VG_H_ 19 | #define GLUS_DEFINE_COLOR_CHANNEL_VG_H_ 20 | 21 | #define GLUS_SINGLE_CHANNEL GLUS_ALPHA 22 | 23 | #endif /* GLUS_DEFINE_COLOR_CHANNEL_VG_H_ */ 24 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_color_vg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_COLOR_H_ 19 | #define GLUS_DEFINE_COLOR_H_ 20 | 21 | #define GLUS_RED 0x00001903 22 | #define GLUS_ALPHA VG_A_8 23 | #define GLUS_RGB 0x00001907 24 | #define GLUS_RGBA VG_sABGR_8888 25 | #define GLUS_LUMINANCE VG_sL_8 26 | 27 | #endif /* GLUS_DEFINE_COLOR_H_ */ 28 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_shader_es.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_SHADER_H_ 19 | #define GLUS_DEFINE_SHADER_H_ 20 | 21 | #define GLUS_VERTEX_SHADER 0x00008B31 22 | #define GLUS_FRAGMENT_SHADER 0x00008B30 23 | 24 | #endif /* GLUS_DEFINE_SHADER_H_ */ 25 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_uint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_UINT_H_ 19 | #define GLUS_DEFINE_UINT_H_ 20 | 21 | #define GLUS_MAX_VERTICES 1048576 22 | #define GLUS_MAX_INDICES (GLUS_MAX_VERTICES*GLUS_VERTICES_FACTOR) 23 | 24 | #define GLUSindex GLUSuint 25 | 26 | #endif /* GLUS_DEFINE_UINT_H_ */ 27 | -------------------------------------------------------------------------------- /GLUS/src/GLUS/glus_define_ushort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef GLUS_DEFINE_USHORT_H_ 19 | #define GLUS_DEFINE_USHORT_H_ 20 | 21 | #define GLUS_MAX_VERTICES 65536 22 | #define GLUS_MAX_INDICES (GLUS_MAX_VERTICES*GLUS_VERTICES_FACTOR) 23 | 24 | #define GLUSindex GLUSushort 25 | 26 | #endif /* GLUS_DEFINE_USHORT_H_ */ 27 | -------------------------------------------------------------------------------- /GLUS/src/glus_line_wavefront.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "GL/glus.h" 19 | 20 | extern GLUSboolean _glusWavefrontParseLine(const GLUSchar* filename, GLUSline* line); 21 | 22 | GLUSboolean GLUSAPIENTRY glusLineLoadWavefront(const GLUSchar* filename, GLUSline* line) 23 | { 24 | return _glusWavefrontParseLine(filename, line); 25 | } 26 | -------------------------------------------------------------------------------- /GLUS/src/glus_memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "GL/glus.h" 19 | 20 | void* GLUSAPIENTRY glusMemoryMalloc(size_t size) 21 | { 22 | return malloc(size); 23 | } 24 | 25 | void GLUSAPIENTRY glusMemoryFree(void* pointer) 26 | { 27 | free(pointer); 28 | } 29 | -------------------------------------------------------------------------------- /GLUS/src/glus_shape_wavefront.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "GL/glus.h" 19 | 20 | extern GLUSboolean _glusWavefrontParse(const GLUSchar* filename, GLUSshape* shape, GLUSwavefront* wavefront, GLUSscene* scene); 21 | 22 | GLUSboolean GLUSAPIENTRY glusShapeLoadWavefront(const GLUSchar* filename, GLUSshape* shape) 23 | { 24 | return _glusWavefrontParse(filename, shape, 0, 0); 25 | } 26 | -------------------------------------------------------------------------------- /GLUS/src/glus_time.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "GL/glus.h" 19 | 20 | GLUSfloat GLUSAPIENTRY glusTimeGetTimestampf() 21 | { 22 | return (GLUSfloat)glfwGetTime(); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /GLUS/src/glus_time_es.c: -------------------------------------------------------------------------------- 1 | /* 2 | * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "GL/glus.h" 19 | 20 | extern double _glusOsGetRawTime(GLUSvoid); 21 | 22 | GLUSfloat GLUSAPIENTRY glusTimeGetTimestampf() 23 | { 24 | return (GLUSfloat)_glusOsGetRawTime(); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /GraphicsEngine/.gitignore: -------------------------------------------------------------------------------- 1 | /x64__Linux__GCC_Debug 2 | -------------------------------------------------------------------------------- /GraphicsEngine/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 3 | environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 4 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/append=true 5 | environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.482826353/appendContributed=true 6 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Debug.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | layout(location = 0, index = 0) out vec4 fragColor; 4 | 5 | void main(void) 6 | { 7 | fragColor = vec4(1.0, 0.0, 0.0, 1.0); 8 | } 9 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Debug.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform mat4 u_projectionMatrix; 4 | uniform mat4 u_viewMatrix; 5 | uniform mat4 u_modelMatrix; 6 | uniform mat3 u_normalModelMatrix; 7 | 8 | in vec4 a_vertex; 9 | in vec3 a_normal; 10 | in vec3 a_bitangent; 11 | in vec3 a_tangent; 12 | in vec2 a_texCoord; 13 | 14 | out vec4 v_vertex; 15 | out vec3 v_normal; 16 | out vec3 v_bitangent; 17 | out vec3 v_tangent; 18 | out vec2 v_texCoord; 19 | 20 | void main(void) 21 | { 22 | v_vertex = u_modelMatrix * a_vertex; 23 | 24 | v_normal = u_normalModelMatrix * a_normal; 25 | v_bitangent = u_normalModelMatrix * a_bitangent; 26 | v_tangent = u_normalModelMatrix * a_tangent; 27 | 28 | v_texCoord = a_texCoord; 29 | 30 | gl_Position = u_projectionMatrix * u_viewMatrix * v_vertex; 31 | } 32 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Font.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform sampler2D u_fontTexture; 4 | uniform vec4 u_fontColor; 5 | 6 | in vec2 v_texCoord; 7 | 8 | layout(location = 0, index = 0) out vec4 fragColor; 9 | 10 | void main(void) 11 | { 12 | fragColor = texture(u_fontTexture, v_texCoord) * u_fontColor; 13 | } 14 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Font.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform mat4 u_projectionMatrix; 4 | uniform mat4 u_viewMatrix; 5 | uniform mat4 u_modelMatrix; 6 | 7 | uniform float u_fontLeft; 8 | uniform float u_fontTop; 9 | uniform float u_fontWidth; 10 | uniform float u_fontHeight; 11 | 12 | in vec4 a_vertex; 13 | in vec2 a_texCoord; 14 | 15 | out vec2 v_texCoord; 16 | 17 | void main(void) 18 | { 19 | v_texCoord = vec2(u_fontLeft + u_fontWidth * a_texCoord.s, u_fontTop + u_fontHeight * a_texCoord.t); 20 | 21 | gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex; 22 | } 23 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Ground.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform float u_repeat; 4 | 5 | in vec4 a_vertex; 6 | in vec3 a_tangent; 7 | in vec3 a_bitangent; 8 | in vec3 a_normal; 9 | in vec2 a_texCoord; 10 | 11 | out vec4 v_c_vertex; 12 | out vec3 v_c_tangent; 13 | out vec3 v_c_bitangent; 14 | out vec3 v_c_normal; 15 | out vec2 v_c_texCoord; 16 | 17 | void main(void) 18 | { 19 | v_c_vertex = a_vertex; 20 | v_c_tangent = a_tangent; 21 | v_c_bitangent = a_bitangent; 22 | v_c_normal = a_normal; 23 | v_c_texCoord = a_texCoord * u_repeat; 24 | 25 | gl_Position = a_vertex; 26 | } 27 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/LineGeometry.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform vec4 u_lineGeometryColor; 4 | 5 | layout(location = 0, index = 0) out vec4 fragColor; 6 | 7 | void main(void) 8 | { 9 | fragColor = u_lineGeometryColor; 10 | } 11 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/LineGeometry.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform mat4 u_projectionMatrix; 4 | uniform mat4 u_viewMatrix; 5 | uniform mat4 u_modelMatrix; 6 | 7 | in vec4 a_vertex; 8 | 9 | void main(void) 10 | { 11 | gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex; 12 | } 13 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/LineGeometryLines.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform mat4 u_projectionMatrix; 4 | uniform mat4 u_viewMatrix; 5 | uniform mat4 u_modelMatrix; 6 | 7 | uniform vec3 u_lineGeometryOffset0; 8 | uniform vec3 u_lineGeometryOffset1; 9 | 10 | in vec4 a_vertex; 11 | 12 | void main(void) 13 | { 14 | int index = gl_VertexID % 2; 15 | 16 | vec4 vertex = a_vertex; 17 | 18 | if (index == 0) 19 | { 20 | vertex += vec4(u_lineGeometryOffset0, 0.0); 21 | } 22 | else 23 | { 24 | vertex += vec4(u_lineGeometryOffset1, 0.0); 25 | } 26 | 27 | gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * vertex; 28 | } 29 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/PostProcess.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform sampler2D u_screenTexture; 4 | uniform sampler2DMS u_screenTextureMS; 5 | uniform sampler1DArray u_blurTexture; 6 | 7 | uniform mat4 u_projectionMatrix; 8 | uniform mat4 u_viewMatrix; 9 | uniform mat4 u_modelMatrix; 10 | 11 | uniform int u_useMS; 12 | 13 | in vec4 a_vertex; 14 | in vec2 a_texCoord; 15 | 16 | out vec2 v_texCoord; 17 | flat out vec2 v_texCoordStep; 18 | 19 | flat out int v_texWidthBlur; 20 | flat out float v_texWidthBlurStep; 21 | 22 | out float v_cocRadiusReduction; 23 | 24 | void main(void) 25 | { 26 | ivec2 texSize; 27 | 28 | v_texCoord = a_texCoord; 29 | 30 | if (u_useMS > 0) 31 | { 32 | texSize = textureSize(u_screenTextureMS); 33 | } 34 | else 35 | { 36 | texSize = textureSize(u_screenTexture, 0); 37 | } 38 | 39 | v_texCoordStep = vec2(1.0 / float(texSize.s + 1), 1.0 / float(texSize.t + 1)); 40 | 41 | int texWidth = textureSize(u_blurTexture, 0).s; 42 | v_texWidthBlur = texWidth; 43 | v_texWidthBlurStep = 1.0 / float(texWidth + 1); 44 | 45 | gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex; 46 | } 47 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Sky.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform samplerCube u_cubemap; 4 | 5 | uniform int u_writeBrightColor; 6 | uniform float u_brightColorLimit; 7 | 8 | in vec3 v_ray; 9 | 10 | layout(location = 0, index = 0) out vec4 fragColor; 11 | layout(location = 1, index = 0) out vec4 brightColor; 12 | 13 | void main(void) 14 | { 15 | vec4 color = texture(u_cubemap, v_ray); 16 | 17 | fragColor = color; 18 | 19 | if (u_writeBrightColor > 0) 20 | { 21 | vec3 tempBrightColor = max(color.rgb - vec3(u_brightColorLimit), vec3(0.0)); 22 | 23 | float bright = dot(tempBrightColor, vec3(1.0)); 24 | bright = smoothstep(0.0, 0.5, bright); 25 | 26 | brightColor.rgb = mix(vec3(0.0), color.rgb, bright).rgb; 27 | 28 | brightColor.a = 1.0; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /GraphicsEngine/shader/Sky.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 410 core 2 | 3 | uniform mat4 u_projectionMatrix; 4 | uniform mat4 u_viewMatrix; 5 | uniform mat4 u_modelMatrix; 6 | 7 | in vec4 a_vertex; 8 | 9 | out vec3 v_ray; 10 | 11 | void main(void) 12 | { 13 | v_ray = normalize(a_vertex.xyz); 14 | 15 | gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex; 16 | } 17 | -------------------------------------------------------------------------------- /GraphicsEngine/src/UsedLibs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UsedLibs.h 3 | * 4 | * Created on: 24.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef USEDLIBS_H_ 9 | #define USEDLIBS_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "GL/glus.h" 24 | 25 | #endif /* USEDLIBS_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/concurrency/ThreadSafeCounter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * TaskCounter.cpp 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "ThreadSafeCounter.h" 9 | 10 | ThreadSafeCounter::ThreadSafeCounter() : counter(0) 11 | { 12 | } 13 | 14 | ThreadSafeCounter::ThreadSafeCounter(const ThreadSafeCounter& other) 15 | { 16 | std::lock_guard taskCounterLock(other.counterMutex); 17 | 18 | counter = other.counter; 19 | } 20 | 21 | ThreadSafeCounter::~ThreadSafeCounter() 22 | { 23 | } 24 | 25 | void ThreadSafeCounter::increment() 26 | { 27 | std::lock_guard taskCounterLock(counterMutex); 28 | 29 | counter++; 30 | } 31 | 32 | void ThreadSafeCounter::decrement() 33 | { 34 | std::lock_guard taskCounterLock(counterMutex); 35 | 36 | counter--; 37 | 38 | assert(counter >= 0); 39 | 40 | counterConditionVariable.notify_all(); 41 | } 42 | 43 | void ThreadSafeCounter::waitUntilZero() const 44 | { 45 | std::unique_lock taskCounterLock(counterMutex); 46 | counterConditionVariable.wait(taskCounterLock, [this] {return counter == 0;} ); 47 | } 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/concurrency/ThreadSafeCounter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ThreadSafeCounter.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef THREADSAFECOUNTER_H_ 9 | #define THREADSAFECOUNTER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class ThreadSafeCounter 14 | { 15 | 16 | private: 17 | 18 | std::int32_t counter; 19 | 20 | mutable std::mutex counterMutex; 21 | 22 | mutable std::condition_variable counterConditionVariable; 23 | 24 | public: 25 | ThreadSafeCounter(); 26 | ThreadSafeCounter(const ThreadSafeCounter& other); 27 | ~ThreadSafeCounter(); 28 | 29 | void increment(); 30 | 31 | void decrement(); 32 | 33 | void waitUntilZero() const; 34 | }; 35 | 36 | typedef std::shared_ptr ThreadSafeCounterSP; 37 | 38 | #endif /* THREADSAFECOUNTER_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/filter/GaussFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GaussFilter.h 3 | * 4 | * Created on: 19.12.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GAUSSFILTER_H_ 9 | #define GAUSSFILTER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class GaussFilter 14 | { 15 | 16 | private: 17 | 18 | std::int32_t pixel; 19 | 20 | float sigma; 21 | 22 | float* values; 23 | 24 | public: 25 | GaussFilter(std::int32_t pixel, float sigma); 26 | GaussFilter(const GaussFilter& other); 27 | virtual ~GaussFilter(); 28 | 29 | GaussFilter& operator =(const GaussFilter& other); 30 | 31 | std::int32_t getPixel() const; 32 | 33 | float getSigma() const; 34 | 35 | const float* getValues() const; 36 | 37 | const void* getVoidValues() const; 38 | 39 | std::int32_t getValuesSize() const; 40 | 41 | }; 42 | 43 | #endif /* GAUSSFILTER_H_ */ 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONarray.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONarray.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONarray.h" 9 | 10 | using namespace std; 11 | 12 | JSONarray::JSONarray() : JSONvalue(), allValues() 13 | { 14 | jsonArray = true; 15 | } 16 | 17 | JSONarray::~JSONarray() 18 | { 19 | } 20 | 21 | void JSONarray::addValue(const JSONvalueSP& value) 22 | { 23 | allValues.push_back(value); 24 | } 25 | 26 | JSONvalueSP JSONarray::getValueAt(std::int32_t index) const 27 | { 28 | return allValues.at(index); 29 | } 30 | 31 | const vector& JSONarray::getAllValues() const 32 | { 33 | return allValues; 34 | } 35 | 36 | size_t JSONarray::size() const 37 | { 38 | return allValues.size(); 39 | } 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONarray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONarray.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONARRAY_H_ 9 | #define JSONARRAY_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONarray : public JSONvalue 14 | { 15 | 16 | private: 17 | 18 | std::vector allValues; 19 | 20 | public: 21 | 22 | JSONarray(); 23 | virtual ~JSONarray(); 24 | 25 | void addValue(const JSONvalueSP& value); 26 | 27 | JSONvalueSP getValueAt(std::int32_t index) const; 28 | 29 | const std::vector& getAllValues() const; 30 | 31 | size_t size() const; 32 | 33 | }; 34 | 35 | typedef std::shared_ptr JSONarraySP; 36 | 37 | #endif /* JSONARRAY_H_ */ 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONfalse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONfalse.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONfalse.h" 9 | 10 | using namespace std; 11 | 12 | JSONfalse::JSONfalse() : JSONvalue() 13 | { 14 | jsonFalse = true; 15 | } 16 | 17 | JSONfalse::~JSONfalse() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONfalse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONfalse.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONFALSE_H_ 9 | #define JSONFALSE_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONfalse : public JSONvalue 14 | { 15 | 16 | public: 17 | 18 | JSONfalse(); 19 | virtual ~JSONfalse(); 20 | 21 | }; 22 | 23 | typedef std::shared_ptr JSONfalseSP; 24 | 25 | #endif /* JSONFALSE_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONnull.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONnull.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONnull.h" 9 | 10 | using namespace std; 11 | 12 | JSONnull::JSONnull() : JSONvalue() 13 | { 14 | jsonNull = true; 15 | } 16 | 17 | JSONnull::~JSONnull() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONnull.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONnull.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONNULL_H_ 9 | #define JSONNULL_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONnull : public JSONvalue 14 | { 15 | 16 | public: 17 | 18 | JSONnull(); 19 | virtual ~JSONnull(); 20 | 21 | }; 22 | 23 | typedef std::shared_ptr JSONnullSP; 24 | 25 | #endif /* JSONNULL_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONnumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONnumber.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONNUMBER_H_ 9 | #define JSONNUMBER_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONnumber : public JSONvalue 14 | { 15 | 16 | private: 17 | 18 | bool isFloat; 19 | 20 | union Value 21 | { 22 | float floatValue; 23 | std::int32_t integerValue; 24 | } value; 25 | 26 | public: 27 | 28 | JSONnumber(); 29 | JSONnumber(const std::string& value, bool isFloat); 30 | JSONnumber(float value); 31 | JSONnumber(std::int32_t value); 32 | virtual ~JSONnumber(); 33 | 34 | float getFloatValue() const; 35 | void setFloatValue(float value); 36 | 37 | std::int32_t getIntegerValue() const; 38 | void setIntegerValue(std::int32_t integerValue); 39 | 40 | bool isFloatValue() const; 41 | 42 | }; 43 | 44 | typedef std::shared_ptr JSONnumberSP; 45 | 46 | #endif /* JSONNUMBER_H_ */ 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONobject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONobject.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONobject.h" 9 | 10 | using namespace std; 11 | 12 | JSONobject::JSONobject() : JSONvalue(), allKeyValues(), allKeys() 13 | { 14 | jsonObject = true; 15 | } 16 | 17 | JSONobject::~JSONobject() 18 | { 19 | } 20 | 21 | void JSONobject::addKeyValue(const JSONstringSP& key, const JSONvalueSP& value) 22 | { 23 | allKeyValues[key] = value; 24 | allKeys.push_back(key); 25 | } 26 | 27 | bool JSONobject::hasKey(const JSONstringSP& key) const 28 | { 29 | return allKeyValues.find(key) != allKeyValues.end(); 30 | } 31 | 32 | JSONvalueSP JSONobject::getValue(const JSONstringSP& key) const 33 | { 34 | return allKeyValues.at(key); 35 | } 36 | 37 | const map& JSONobject::getAllKeyValues() const 38 | { 39 | return allKeyValues; 40 | } 41 | 42 | const vector& JSONobject::getAllKeys() const 43 | { 44 | return allKeys; 45 | } 46 | 47 | size_t JSONobject::size() const 48 | { 49 | return allKeyValues.size(); 50 | } 51 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONstring.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONstring.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONstring.h" 9 | 10 | using namespace std; 11 | 12 | JSONstring::JSONstring() : JSONvalue(), value("") 13 | { 14 | jsonString = true; 15 | } 16 | 17 | JSONstring::JSONstring(const string& value) : JSONvalue(), value(value) 18 | { 19 | jsonString = true; 20 | } 21 | 22 | JSONstring::~JSONstring() 23 | { 24 | } 25 | 26 | const string& JSONstring::getValue() const 27 | { 28 | return value; 29 | } 30 | 31 | void JSONstring::setValue(const string& value) 32 | { 33 | this->value = value; 34 | } 35 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONstring.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONSTRING_H_ 9 | #define JSONSTRING_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONstring : public JSONvalue 14 | { 15 | 16 | private: 17 | 18 | std::string value; 19 | 20 | public: 21 | 22 | JSONstring(); 23 | JSONstring(const std::string& value); 24 | virtual ~JSONstring(); 25 | 26 | const std::string& getValue() const; 27 | 28 | void setValue(const std::string& value); 29 | 30 | }; 31 | 32 | typedef std::shared_ptr JSONstringSP; 33 | 34 | #endif /* JSONSTRING_H_ */ 35 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONtrue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONtrue.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONtrue.h" 9 | 10 | using namespace std; 11 | 12 | JSONtrue::JSONtrue() : JSONvalue() 13 | { 14 | jsonTrue = true; 15 | } 16 | 17 | JSONtrue::~JSONtrue() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONtrue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONtrue.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONTRUE_H_ 9 | #define JSONTRUE_H_ 10 | 11 | #include "JSONvalue.h" 12 | 13 | class JSONtrue : public JSONvalue 14 | { 15 | 16 | public: 17 | 18 | JSONtrue(); 19 | virtual ~JSONtrue(); 20 | 21 | }; 22 | 23 | typedef std::shared_ptr JSONtrueSP; 24 | 25 | #endif /* JSONTRUE_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONvalue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONvalue.cpp 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "JSONvalue.h" 9 | 10 | using namespace std; 11 | 12 | JSONvalue::JSONvalue() : 13 | jsonObject(false), jsonArray(false), jsonNumber(false), jsonString(false), jsonTrue(false), jsonFalse(false), jsonNull(false) 14 | { 15 | } 16 | 17 | JSONvalue::~JSONvalue() 18 | { 19 | } 20 | 21 | bool JSONvalue::isJsonObject() const 22 | { 23 | return jsonObject; 24 | } 25 | 26 | bool JSONvalue::isJsonArray() const 27 | { 28 | return jsonArray; 29 | } 30 | 31 | bool JSONvalue::isJsonNumber() const 32 | { 33 | return jsonNumber; 34 | } 35 | 36 | bool JSONvalue::isJsonString() const 37 | { 38 | return jsonString; 39 | } 40 | 41 | bool JSONvalue::isJsonTrue() const 42 | { 43 | return jsonTrue; 44 | } 45 | 46 | bool JSONvalue::isJsonFalse() const 47 | { 48 | return jsonFalse; 49 | } 50 | 51 | bool JSONvalue::isJsonNull() const 52 | { 53 | return jsonNull; 54 | } 55 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/json/JSONvalue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * JSONvalue.h 3 | * 4 | * Created on: Jun 16, 2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef JSONVALUE_H_ 9 | #define JSONVALUE_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class JSONvalue 14 | { 15 | 16 | protected: 17 | 18 | bool jsonObject; 19 | bool jsonArray; 20 | bool jsonNumber; 21 | bool jsonString; 22 | bool jsonTrue; 23 | bool jsonFalse; 24 | bool jsonNull; 25 | 26 | protected: 27 | 28 | JSONvalue(); 29 | virtual ~JSONvalue(); 30 | 31 | public: 32 | 33 | bool isJsonArray() const; 34 | bool isJsonObject() const; 35 | bool isJsonNumber() const; 36 | bool isJsonString() const; 37 | bool isJsonTrue() const; 38 | bool isJsonFalse() const; 39 | bool isJsonNull() const; 40 | 41 | }; 42 | 43 | typedef std::shared_ptr JSONvalueSP; 44 | 45 | #endif /* JSONVALUE_H_ */ 46 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/AxisAlignedBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Box.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef AXISALIGNEDBOX_H_ 9 | #define AXISALIGNEDBOX_H_ 10 | 11 | #include "Point4.h" 12 | 13 | class AxisAlignedBox 14 | { 15 | 16 | protected: 17 | 18 | Point4 center; 19 | 20 | float halfWidth; 21 | float halfHeight; 22 | float halfDepth; 23 | 24 | public: 25 | 26 | AxisAlignedBox(); 27 | AxisAlignedBox(const Point4& center, float halfWidth, float halfHeight, float halfDepth); 28 | virtual ~AxisAlignedBox(); 29 | 30 | const Point4& getCenter() const; 31 | void setCenter(const Point4& center); 32 | float getHalfWidth() const; 33 | void setHalfWidth(float halfWidth); 34 | float getHalfHeight() const; 35 | void setHalfHeight(float halfHeight); 36 | float getHalfDepth() const; 37 | void setHalfDepth(float halfDepth); 38 | 39 | }; 40 | 41 | #endif /* AXISALIGNEDBOX_H_ */ 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/Line.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Line.cpp 3 | * 4 | * Created on: 25.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "../../UsedLibs.h" 9 | 10 | #include "Line.h" 11 | 12 | Line::Line() : 13 | point(), direction() 14 | { 15 | } 16 | 17 | Line::Line(const Point4& point, const Vector3& direction) : 18 | point(point) 19 | { 20 | this->direction = direction.normalize(); 21 | } 22 | 23 | Line::Line(const Line& other) : 24 | point(other.point), direction(other.direction) 25 | { 26 | } 27 | 28 | Line::~Line() 29 | { 30 | } 31 | 32 | float Line::distance(const Point4& point) const 33 | { 34 | Vector3 v = point - this->point; 35 | 36 | float c = v.length(); 37 | 38 | float a = v.dot(direction); 39 | 40 | return sqrtf(c * c - a * a); 41 | } 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/Line.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Line.h 3 | * 4 | * Created on: 25.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef LINE_H_ 9 | #define LINE_H_ 10 | 11 | #include "Point4.h" 12 | #include "Vector3.h" 13 | 14 | class Line 15 | { 16 | 17 | protected: 18 | 19 | Point4 point; 20 | Vector3 direction; 21 | 22 | public: 23 | 24 | Line(); 25 | Line(const Point4& point, const Vector3& direction); 26 | Line(const Line& other); 27 | ~Line(); 28 | 29 | float distance(const Point4& point) const; 30 | 31 | }; 32 | 33 | #endif /* LINE_H_ */ 34 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/Plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Plane.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef PLANE_H_ 9 | #define PLANE_H_ 10 | 11 | #include "Point4.h" 12 | #include "Sphere.h" 13 | #include "Vector3.h" 14 | 15 | class Plane 16 | { 17 | 18 | friend class Matrix4x4; 19 | 20 | protected: 21 | 22 | float plane[4]; 23 | 24 | public: 25 | 26 | Plane(); 27 | Plane(const Point4& point, const Vector3& normal); 28 | Plane(const Vector3& normal, float d); 29 | Plane(const Plane& other); 30 | ~Plane(); 31 | 32 | Plane& operator =(const Plane& other); 33 | 34 | void setPlane(const Plane& other); 35 | 36 | void setPlane(const Vector3& normal, float d); 37 | 38 | const float* getPlane() const; 39 | 40 | float distance(const Point4& other) const; 41 | 42 | float distance(const Sphere& other) const; 43 | 44 | }; 45 | 46 | #endif /* PLANE_H_ */ 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/Sphere.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Sphere.cpp 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "../../UsedLibs.h" 9 | 10 | #include "Sphere.h" 11 | 12 | Sphere::Sphere() : 13 | center(), radius(0.0f) 14 | { 15 | } 16 | 17 | Sphere::Sphere(const Point4& center, float radius) : 18 | center(center), radius(radius) 19 | { 20 | } 21 | 22 | Sphere::~Sphere() 23 | { 24 | } 25 | 26 | const Point4& Sphere::getCenter() const 27 | { 28 | return center; 29 | } 30 | 31 | void Sphere::setCenter(const Point4& center) 32 | { 33 | this->center = center; 34 | } 35 | 36 | float Sphere::getRadius() const 37 | { 38 | return radius; 39 | } 40 | 41 | void Sphere::setRadius(float radius) 42 | { 43 | this->radius = radius; 44 | } 45 | 46 | float Sphere::distance(const Point4& point) const 47 | { 48 | return center.distance(point); 49 | } 50 | 51 | float Sphere::distance(const Sphere& other) const 52 | { 53 | return center.distance(other.center); 54 | } 55 | 56 | float Sphere::distance(const Plane& other) const 57 | { 58 | return other.distance(*this); 59 | } 60 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/math/Sphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Sphere.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef SPHERE_H_ 9 | #define SPHERE_H_ 10 | 11 | #include "Plane.h" 12 | #include "Point4.h" 13 | 14 | class Sphere 15 | { 16 | 17 | protected: 18 | 19 | Point4 center; 20 | float radius; 21 | 22 | public: 23 | 24 | Sphere(); 25 | Sphere(const Point4& center, float radius); 26 | virtual ~Sphere(); 27 | 28 | const Point4& getCenter() const; 29 | void setCenter(const Point4& center); 30 | 31 | float getRadius() const; 32 | void setRadius(float radius); 33 | 34 | float distance(const Point4& point) const; 35 | 36 | float distance(const Sphere& other) const; 37 | 38 | float distance(const Plane& other) const; 39 | 40 | }; 41 | 42 | #endif /* SPHERE_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise.h 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PERLINNOISE_H_ 9 | #define PERLINNOISE_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class PerlinNoise 14 | { 15 | protected: 16 | 17 | std::uint8_t* data; 18 | std::int32_t dataSize; 19 | 20 | std::int32_t seed; 21 | 22 | float frequency; 23 | 24 | float amplitude; 25 | 26 | float persistence; 27 | 28 | std::int32_t octaves; 29 | 30 | public: 31 | 32 | PerlinNoise(std::int32_t seed, float frequency, float amplitude, float persistence, std::int32_t octaves); 33 | PerlinNoise(const PerlinNoise& other); 34 | virtual ~PerlinNoise(); 35 | 36 | PerlinNoise& operator = (const PerlinNoise& other); 37 | 38 | void freeData(); 39 | 40 | const std::uint8_t* getData() const; 41 | 42 | std::int32_t getDataSize() const; 43 | 44 | }; 45 | 46 | #endif /* PERLINNOISE_H_ */ 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise1D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise1D.cpp 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "PerlinNoise1D.h" 9 | 10 | PerlinNoise1D::PerlinNoise1D(int32_t width, int32_t seed, float frequency, float amplitude, float persistence, int32_t octaves) : 11 | PerlinNoise(seed, frequency, amplitude, persistence, octaves), width(width) 12 | { 13 | if (persistence <= 0.0f) 14 | { 15 | return; 16 | } 17 | 18 | GLUStgaimage image; 19 | 20 | if (!glusPerlinCreateNoise1D(&image, width, seed, frequency, amplitude, persistence, octaves)) 21 | { 22 | return; 23 | } 24 | 25 | data = image.data; 26 | dataSize = width; 27 | } 28 | 29 | PerlinNoise1D::~PerlinNoise1D() 30 | { 31 | } 32 | 33 | int32_t PerlinNoise1D::getWidth() const 34 | { 35 | return width; 36 | } 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise1D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise1D.h 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PERLINNOISE1D_H_ 9 | #define PERLINNOISE1D_H_ 10 | 11 | #include "PerlinNoise.h" 12 | 13 | class PerlinNoise1D : public PerlinNoise 14 | { 15 | 16 | private: 17 | 18 | std::int32_t width; 19 | 20 | public: 21 | 22 | PerlinNoise1D(std::int32_t width, std::int32_t seed, float frequency, float amplitude, float persistence, std::int32_t octaves); 23 | virtual ~PerlinNoise1D(); 24 | 25 | std::int32_t getWidth() const; 26 | 27 | }; 28 | 29 | #endif /* PERLINNOISE1D_H_ */ 30 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise2D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise2D.cpp 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "PerlinNoise2D.h" 9 | 10 | using namespace std; 11 | 12 | PerlinNoise2D::PerlinNoise2D(int32_t width, int32_t height, int32_t seed, float frequency, float amplitude, float persistence, int32_t octaves) : 13 | PerlinNoise(seed, frequency, amplitude, persistence, octaves), width(width), height(height) 14 | { 15 | if (persistence <= 0.0f) 16 | { 17 | return; 18 | } 19 | 20 | GLUStgaimage image; 21 | 22 | if (!glusPerlinCreateNoise2D(&image, width, height, seed, frequency, amplitude, persistence, octaves)) 23 | { 24 | return; 25 | } 26 | 27 | data = image.data; 28 | dataSize = width * height; 29 | } 30 | 31 | PerlinNoise2D::~PerlinNoise2D() 32 | { 33 | } 34 | 35 | int32_t PerlinNoise2D::getWidth() const 36 | { 37 | return width; 38 | } 39 | 40 | int32_t PerlinNoise2D::getHeight() const 41 | { 42 | return height; 43 | } 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise2D.h 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PERLINNOISE2D_H_ 9 | #define PERLINNOISE2D_H_ 10 | 11 | #include "PerlinNoise.h" 12 | 13 | class PerlinNoise2D : public PerlinNoise 14 | { 15 | private: 16 | 17 | std::int32_t width; 18 | std::int32_t height; 19 | 20 | public: 21 | 22 | PerlinNoise2D(std::int32_t width, std::int32_t height, std::int32_t seed, float frequency, float amplitude, float persistence, std::int32_t octaves); 23 | virtual ~PerlinNoise2D(); 24 | 25 | std::int32_t getWidth() const; 26 | 27 | std::int32_t getHeight() const; 28 | 29 | }; 30 | 31 | #endif /* PERLINNOISE2D_H_ */ 32 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise3D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise3D.cpp 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "PerlinNoise3D.h" 9 | 10 | PerlinNoise3D::PerlinNoise3D(int32_t width, int32_t height, int32_t depth, int32_t seed, float frequency, float amplitude, float persistence, int32_t octaves) : 11 | PerlinNoise(seed, frequency, amplitude, persistence, octaves), width(width), height(height), depth(depth) 12 | { 13 | if (persistence <= 0.0f) 14 | { 15 | return; 16 | } 17 | 18 | GLUStgaimage image; 19 | 20 | if (!glusPerlinCreateNoise3D(&image, width, height, depth, seed, frequency, amplitude, persistence, octaves)) 21 | { 22 | return; 23 | } 24 | 25 | data = image.data; 26 | dataSize = width * height * depth; 27 | } 28 | 29 | PerlinNoise3D::~PerlinNoise3D() 30 | { 31 | } 32 | 33 | int32_t PerlinNoise3D::getWidth() const 34 | { 35 | return width; 36 | } 37 | 38 | int32_t PerlinNoise3D::getHeight() const 39 | { 40 | return height; 41 | } 42 | 43 | int32_t PerlinNoise3D::getDepth() const 44 | { 45 | return depth; 46 | } 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/noise/PerlinNoise3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PerlinNoise3D.h 3 | * 4 | * Created on: 17.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PERLINNOISE3D_H_ 9 | #define PERLINNOISE3D_H_ 10 | 11 | #include "PerlinNoise.h" 12 | 13 | class PerlinNoise3D : public PerlinNoise 14 | { 15 | 16 | private: 17 | 18 | std::int32_t width; 19 | std::int32_t height; 20 | std::int32_t depth; 21 | 22 | public: 23 | 24 | PerlinNoise3D(std::int32_t width, std::int32_t height, std::int32_t depth, std::int32_t seed, float frequency, float amplitude, float persistence, std::int32_t octaves); 25 | virtual ~PerlinNoise3D(); 26 | 27 | std::int32_t getWidth() const; 28 | 29 | std::int32_t getHeight() const; 30 | 31 | std::int32_t getDepth() const; 32 | 33 | }; 34 | 35 | #endif /* PERLINNOISE3D_H_ */ 36 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/os/Directory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Directory.h 3 | * 4 | * Created on: 01.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DIRECTORY_H_ 9 | #define DIRECTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class Directory 14 | { 15 | 16 | public: 17 | 18 | Directory(); 19 | ~Directory(); 20 | 21 | static bool create(const std::string& name); 22 | 23 | }; 24 | 25 | #endif /* DIRECTORY_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/os/Directory_Linux.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Directory_Linux.cpp 3 | * 4 | * Created on: 01.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include 9 | 10 | #include "Directory.h" 11 | 12 | using namespace std; 13 | 14 | Directory::Directory() 15 | { 16 | } 17 | 18 | Directory::~Directory() 19 | { 20 | } 21 | 22 | bool Directory::create(const string& name) 23 | { 24 | return mkdir(name.c_str(), 0777) == 0; 25 | } 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/os/Directory_Windows.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Directory_Windows.cpp 3 | * 4 | * Created on: 01.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include 9 | 10 | #include "Directory.h" 11 | 12 | using namespace std; 13 | 14 | Directory::Directory() 15 | { 16 | } 17 | 18 | Directory::~Directory() 19 | { 20 | } 21 | 22 | bool Directory::create(const string& name) 23 | { 24 | return _mkdir(name.c_str()) == 0; 25 | } 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/ConeShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ConeShape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "ConeShape.h" 9 | 10 | using namespace std; 11 | 12 | ConeShape::ConeShape(float halfExtend, float radius, uint32_t numberSlices, uint32_t numberStacks) : Shape() 13 | { 14 | glusShapeCreateConef(&shape, halfExtend, radius, numberSlices, numberStacks); 15 | } 16 | 17 | ConeShape::~ConeShape() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/ConeShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ConeShape.h 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CONESHAPE_H_ 9 | #define CONESHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class ConeShape: public Shape 14 | { 15 | 16 | public: 17 | 18 | ConeShape(float halfExtend, float radius, std::uint32_t numberSlices, std::uint32_t numberStacks); 19 | virtual ~ConeShape(); 20 | 21 | }; 22 | 23 | #endif /* CONESHAPE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/CubeShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CubeShape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "CubeShape.h" 9 | 10 | CubeShape::CubeShape(float halfExtend) : Shape() 11 | { 12 | glusShapeCreateCubef(&shape, halfExtend); 13 | } 14 | 15 | CubeShape::~CubeShape() 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/CubeShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CubeShape.h 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CUBESHAPE_H_ 9 | #define CUBESHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class CubeShape : public Shape 14 | { 15 | 16 | public: 17 | 18 | CubeShape(float halfExtend); 19 | virtual ~CubeShape(); 20 | 21 | }; 22 | 23 | #endif /* CUBESHAPE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/CylinderShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CylinderShape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "CylinderShape.h" 9 | 10 | using namespace std; 11 | 12 | CylinderShape::CylinderShape(float halfExtend, float radius, uint32_t numberSlices) : Shape() 13 | { 14 | glusShapeCreateCylinderf(&shape, halfExtend, radius, numberSlices); 15 | } 16 | 17 | CylinderShape::~CylinderShape() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/CylinderShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CylinderShape.h 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CYLINDERSHAPE_H_ 9 | #define CYLINDERSHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class CylinderShape: public Shape 14 | { 15 | 16 | public: 17 | 18 | CylinderShape(float halfExtend, float radius, std::uint32_t numberSlices); 19 | virtual ~CylinderShape(); 20 | 21 | }; 22 | 23 | #endif /* CYLINDERSHAPE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/DomeShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DomeShape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "DomeShape.h" 9 | 10 | using namespace std; 11 | 12 | DomeShape::DomeShape(float radius, uint32_t numberSlices) : Shape() 13 | { 14 | glusShapeCreateDomef(&shape, radius, numberSlices); 15 | } 16 | 17 | DomeShape::~DomeShape() 18 | { 19 | } 20 | 21 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/DomeShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DomeShape.h 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DOMESHAPE_H_ 9 | #define DOMESHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class DomeShape: public Shape 14 | { 15 | public: 16 | DomeShape(float radius, std::uint32_t numberSlices); 17 | virtual ~DomeShape(); 18 | }; 19 | 20 | #endif /* DOMESHAPE_H_ */ 21 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/GridPlaneShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GridPlaneShape.cpp 3 | * 4 | * Created on: 09.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "GridPlaneShape.h" 9 | 10 | using namespace std; 11 | 12 | GridPlaneShape::GridPlaneShape(float horizontalExtend, float verticalExtend, uint32_t rows, uint32_t columns) : 13 | Shape() 14 | { 15 | glusShapeCreateRectangularGridPlanef(&shape, horizontalExtend, verticalExtend, rows, columns, GLUS_FALSE); 16 | } 17 | 18 | GridPlaneShape::~GridPlaneShape() 19 | { 20 | } 21 | 22 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/GridPlaneShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GridPlaneSape.h 3 | * 4 | * Created on: 09.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GRIDPLANESHAPE_H_ 9 | #define GRIDPLANESHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class GridPlaneShape : public Shape 14 | { 15 | public: 16 | GridPlaneShape(float horizontalExtend, float verticalExtend, std::uint32_t rows, std::uint32_t columns); 17 | virtual ~GridPlaneShape(); 18 | }; 19 | 20 | #endif /* GRIDPLANESHAPE_H_ */ 21 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/Shape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Shape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "Shape.h" 9 | 10 | Shape::Shape() 11 | { 12 | memset(&shape, 0, sizeof(GLUSshape)); 13 | } 14 | 15 | Shape::Shape(const GLUSshape& shape) : shape(shape) 16 | { 17 | } 18 | 19 | Shape::~Shape() 20 | { 21 | glusShapeDestroyf(&shape); 22 | } 23 | 24 | Shape& Shape::operator =(const Shape& other) 25 | { 26 | if (this == &other) 27 | { 28 | return *this; 29 | } 30 | 31 | glusShapeDestroyf(&shape); 32 | 33 | glusShapeCopyf(&shape, &other.shape); 34 | 35 | return *this; 36 | } 37 | 38 | const GLUSshape& Shape::getShape() const 39 | { 40 | return shape; 41 | } 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/Shape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Shape.h 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SHAPE_H_ 9 | #define SHAPE_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class Shape 14 | { 15 | 16 | protected: 17 | 18 | GLUSshape shape; 19 | 20 | public: 21 | 22 | Shape(); 23 | Shape(const GLUSshape& shape); 24 | virtual ~Shape(); 25 | 26 | Shape& operator =(const Shape& other); 27 | 28 | const GLUSshape& getShape() const; 29 | }; 30 | 31 | #endif /* SHAPE_H_ */ 32 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/SphereShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SphereShape.cpp 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "SphereShape.h" 9 | 10 | using namespace std; 11 | 12 | SphereShape::SphereShape(float radius, uint32_t numberSlices) : Shape() 13 | { 14 | glusShapeCreateSpheref(&shape, radius, numberSlices); 15 | } 16 | 17 | SphereShape::~SphereShape() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/SphereShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SphereShape.h 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SPHERESHAPE_H_ 9 | #define SPHERESHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class SphereShape : public Shape 14 | { 15 | 16 | public: 17 | 18 | SphereShape(float radius, std::uint32_t numberSlices); 19 | virtual ~SphereShape(); 20 | 21 | }; 22 | 23 | #endif /* SPHERESHAPE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/TorusShape.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * TorusShape.cpp 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "TorusShape.h" 9 | 10 | using namespace std; 11 | 12 | TorusShape::TorusShape(float innerRadius, float outerRadius, uint32_t numberSlices, uint32_t numberStacks) : Shape() 13 | { 14 | glusShapeCreateTorusf(&shape, innerRadius, outerRadius, numberSlices, numberStacks); 15 | } 16 | 17 | TorusShape::~TorusShape() 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/primitive/TorusShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TorusShape.h 3 | * 4 | * Created on: 09.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TORUSSHAPE_H_ 9 | #define TORUSSHAPE_H_ 10 | 11 | #include "Shape.h" 12 | 13 | class TorusShape : public Shape 14 | { 15 | 16 | public: 17 | 18 | TorusShape(float innerRadius, float outerRadius, std::uint32_t numberSlices, std::uint32_t numberStacks); 19 | virtual ~TorusShape(); 20 | 21 | }; 22 | 23 | #endif /* TORUSSHAPE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/statistic/FrameCounter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FrameCounter.h 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FRAMECOUNTER_H_ 9 | #define FRAMECOUNTER_H_ 10 | 11 | class FrameCounter 12 | { 13 | 14 | private: 15 | 16 | float numberFrames; 17 | 18 | float elapsedTime; 19 | 20 | float framesPerSecondAsFloat; 21 | 22 | char framesPerSecondAsString[32]; 23 | 24 | void updateFramesPerSecond(); 25 | 26 | public: 27 | FrameCounter(); 28 | virtual ~FrameCounter(); 29 | 30 | void reset(); 31 | 32 | void increaseNumberFrames(); 33 | 34 | bool increaseElapsedTime(float deltaTime); 35 | 36 | float calulateFramesPerSecondAsFloat(); 37 | 38 | const char* calculateFramesPerSecondAsString(); 39 | 40 | }; 41 | 42 | #endif /* FRAMECOUNTER_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/stereotype/Singleton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Singleton.h 3 | * 4 | * Created on: 22.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SINGLETON_H_ 9 | #define SINGLETON_H_ 10 | 11 | template 12 | class Singleton 13 | { 14 | 15 | private: 16 | 17 | static S* instance; 18 | 19 | protected: 20 | 21 | Singleton() 22 | { 23 | } 24 | 25 | virtual ~Singleton() 26 | { 27 | } 28 | 29 | public: 30 | 31 | static S* getInstance() 32 | { 33 | if (!instance) 34 | { 35 | instance = new S(); 36 | } 37 | 38 | return instance; 39 | } 40 | 41 | static void terminate() 42 | { 43 | if (instance) 44 | { 45 | delete instance; 46 | 47 | instance = nullptr; 48 | } 49 | } 50 | 51 | }; 52 | 53 | template 54 | S* Singleton::instance = nullptr; 55 | 56 | #endif /* SINGLETON_H_ */ 57 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer0/stl/Helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Helper.h 3 | * 4 | * Created on: 17.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef HELPER_H_ 9 | #define HELPER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | template 14 | typename std::map::const_iterator less_equal_bound(const std::map& searchMap, const KeyType& searchKey) 15 | { 16 | if (searchMap.size() == 0) 17 | { 18 | return searchMap.end(); 19 | } 20 | 21 | auto walker = searchMap.upper_bound(searchKey); 22 | 23 | if (walker != searchMap.begin()) 24 | { 25 | return --walker; 26 | } 27 | 28 | return searchMap.end(); 29 | } 30 | 31 | #endif /* HELPER_H_ */ 32 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/collision/AxisAlignedBoundingBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AxisAlignedBoundingBox.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef AXISALIGNEDBOUNDINGBOX_H_ 9 | #define AXISALIGNEDBOUNDINGBOX_H_ 10 | 11 | #include "../../layer0/math/AxisAlignedBox.h" 12 | #include "../../layer0/math/Point4.h" 13 | #include "BoundingSphere.h" 14 | 15 | class AxisAlignedBoundingBox : public AxisAlignedBox 16 | { 17 | 18 | public: 19 | 20 | AxisAlignedBoundingBox(); 21 | AxisAlignedBoundingBox(const Point4& center, float halfWidth, float halfHeight, float halfDepth); 22 | virtual ~AxisAlignedBoundingBox(); 23 | 24 | bool intersect(const AxisAlignedBoundingBox& axisAlignedBoundingBox) const; 25 | 26 | bool encloses(const Point4& point) const; 27 | 28 | bool encloses(const AxisAlignedBoundingBox& axisAlignedBoundingBox) const; 29 | 30 | bool encloses(const BoundingSphere& boundingSphere) const; 31 | 32 | bool inside(const BoundingSphere& boundingSphere) const; 33 | 34 | }; 35 | 36 | #endif /* AXISALIGNEDBOUNDINGBOX_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/collision/BoundingSphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * BoundingSphere.h 3 | * 4 | * Created on: 22.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef BOUNDINGSPHERE_H_ 9 | #define BOUNDINGSPHERE_H_ 10 | 11 | #include "../../layer0/math/Point4.h" 12 | #include "../../layer0/math/Sphere.h" 13 | 14 | class AxisAlignedBoundingBox; 15 | 16 | class BoundingSphere: public Sphere 17 | { 18 | 19 | public: 20 | 21 | BoundingSphere(); 22 | BoundingSphere(const Point4& center, float radius); 23 | virtual ~BoundingSphere(); 24 | 25 | bool intersect(const BoundingSphere& boundingSphere) const; 26 | 27 | bool encloses(const Point4& point) const; 28 | 29 | bool encloses(const BoundingSphere& boundingSphere) const; 30 | 31 | bool encloses(const AxisAlignedBoundingBox& axisAlignedBox) const; 32 | 33 | bool inside(const AxisAlignedBoundingBox& axisAlignedBox) const; 34 | 35 | }; 36 | 37 | #endif /* BOUNDINGSPHERE_H_ */ 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/Command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Command.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef COMMAND_H_ 9 | #define COMMAND_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/concurrency/ThreadsafeQueue.h" 14 | 15 | class Command 16 | { 17 | 18 | friend class WorkerManager; 19 | 20 | protected: 21 | 22 | Command() {} 23 | virtual ~Command() {} 24 | 25 | public: 26 | 27 | virtual bool execute() = 0; 28 | 29 | virtual void recycle() = 0; 30 | }; 31 | 32 | typedef std::shared_ptr > CommandQueueSP; 33 | 34 | #endif /* COMMAND_H_ */ 35 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/StopCommand.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * StopCommand.cpp 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../UsedLibs.h" 9 | 10 | #include "StopCommand.h" 11 | 12 | StopCommand::StopCommand(const StopCommandRecycleQueueSP& stopCommandRecycleQueue) : Command(), stopCommandRecycleQueue(stopCommandRecycleQueue) 13 | { 14 | } 15 | 16 | StopCommand::~StopCommand() 17 | { 18 | } 19 | 20 | bool StopCommand::execute() 21 | { 22 | glusLogPrint(GLUS_LOG_INFO, "Requesting stopping worker thread"); 23 | 24 | return false; 25 | } 26 | 27 | void StopCommand::recycle() 28 | { 29 | stopCommandRecycleQueue->add(this); 30 | } 31 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/StopCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * StopCommand.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef STOPCOMMAND_H_ 9 | #define STOPCOMMAND_H_ 10 | 11 | 12 | #include "../../layer0/concurrency/ThreadsafeQueue.h" 13 | #include "Command.h" 14 | 15 | class StopCommand: public Command 16 | { 17 | 18 | friend class WorkerManager; 19 | 20 | private: 21 | 22 | std::shared_ptr > stopCommandRecycleQueue; 23 | 24 | StopCommand(const std::shared_ptr >& stopCommandRecycleQueue); 25 | virtual ~StopCommand(); 26 | 27 | public: 28 | 29 | virtual bool execute(); 30 | 31 | virtual void recycle(); 32 | }; 33 | 34 | typedef std::shared_ptr > StopCommandRecycleQueueSP; 35 | 36 | #endif /* STOPCOMMAND_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/Worker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Worker.cpp 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "Worker.h" 9 | 10 | using namespace std; 11 | 12 | Worker::Worker(const CommandQueueSP& workerQueue) : commandQueue(workerQueue) 13 | { 14 | workerThread = new thread(&Worker::run, this); 15 | } 16 | 17 | Worker::~Worker() 18 | { 19 | } 20 | 21 | void Worker::run() const 22 | { 23 | glusLogPrint(GLUS_LOG_INFO, "Worker thread started"); 24 | 25 | bool execute = true; 26 | 27 | Command* currentCommand = nullptr; 28 | 29 | while (execute) 30 | { 31 | commandQueue->waitAndTake(currentCommand); 32 | 33 | if (currentCommand) 34 | { 35 | execute = currentCommand->execute(); 36 | 37 | currentCommand->recycle(); 38 | } 39 | else 40 | { 41 | glusLogPrint(GLUS_LOG_WARNING, "Empty command"); 42 | } 43 | } 44 | 45 | glusLogPrint(GLUS_LOG_INFO, "Worker thread stopped"); 46 | } 47 | 48 | void Worker::join() 49 | { 50 | workerThread->join(); 51 | 52 | delete workerThread; 53 | 54 | workerThread = nullptr; 55 | } 56 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/Worker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Worker.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef WORKER_H_ 9 | #define WORKER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "Command.h" 14 | 15 | class Worker 16 | { 17 | 18 | private: 19 | 20 | CommandQueueSP commandQueue; 21 | 22 | std::thread* workerThread; 23 | 24 | public: 25 | Worker(const CommandQueueSP& workerQueue); 26 | ~Worker(); 27 | 28 | void run() const; 29 | 30 | void join(); 31 | 32 | }; 33 | 34 | typedef std::shared_ptr WorkerSP; 35 | 36 | #endif /* WORKER_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/command/WorkerManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WorkerManager.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef WORKERMANAGER_H_ 9 | #define WORKERMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/Singleton.h" 14 | #include "../../layer0/stereotype/ValueVector.h" 15 | 16 | #include "StopCommand.h" 17 | #include "Worker.h" 18 | 19 | class WorkerManager : public Singleton 20 | { 21 | 22 | friend class Singleton; 23 | 24 | private: 25 | 26 | StopCommandRecycleQueueSP stopCommandRecycleQueue; 27 | 28 | CommandQueueSP commandQueue; 29 | 30 | ValueVector allWorker; 31 | 32 | WorkerManager(); 33 | virtual ~WorkerManager(); 34 | 35 | public: 36 | 37 | void addWorker(); 38 | 39 | void removeAllWorker(); 40 | 41 | uint32_t getNumberWorkers() const; 42 | 43 | void sendCommand(Command* command); 44 | 45 | }; 46 | 47 | #endif /* WORKERMANAGER_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/event/Event.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Event.cpp 3 | * 4 | * Created on: 07.01.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "Event.h" 9 | 10 | #include "EventReceiver.h" 11 | 12 | Event::Event(const EventReceiverSP& eventReceiver) : 13 | eventReceiver(eventReceiver) 14 | { 15 | } 16 | 17 | Event::~Event() 18 | { 19 | } 20 | 21 | const EventReceiverSP& Event::getEventReceiver() const 22 | { 23 | return eventReceiver; 24 | } 25 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/event/Event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Event.h 3 | * 4 | * Created on: 07.01.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef EVENT_H_ 9 | #define EVENT_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "EventReceiver.h" 14 | 15 | class Event 16 | { 17 | 18 | private: 19 | 20 | const EventReceiverSP eventReceiver; 21 | 22 | public: 23 | 24 | Event(const EventReceiverSP& eventReceiver); 25 | 26 | virtual ~Event(); 27 | 28 | const EventReceiverSP& getEventReceiver() const; 29 | 30 | }; 31 | 32 | typedef std::shared_ptr EventSP; 33 | 34 | #endif /* EVENT_H_ */ 35 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/event/EventManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EventManager.h 3 | * 4 | * Created on: 07.01.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef EVENTMANAGER_H_ 9 | #define EVENTMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/concurrency/ThreadsafeQueue.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | #include "../../layer0/stereotype/ValueVector.h" 16 | 17 | #include "Event.h" 18 | #include "EventReceiver.h" 19 | 20 | class EventManager : public Singleton 21 | { 22 | 23 | friend class Singleton; 24 | 25 | private: 26 | 27 | mutable std::mutex eventMutex; 28 | 29 | ThreadsafeQueue allEvents; 30 | 31 | ValueVector allEventReceivers; 32 | 33 | EventManager(); 34 | virtual ~EventManager(); 35 | 36 | public: 37 | 38 | void processEvents(); 39 | 40 | void addEventReceiver(const EventReceiverSP& receiver); 41 | 42 | void removeEventReceiver(const EventReceiverSP& receiver); 43 | 44 | // 45 | 46 | void sendEvent(const EventSP& event); 47 | 48 | const ValueVector& getEventReceivers() const; 49 | 50 | }; 51 | 52 | #endif /* EVENTMANAGER_H_ */ 53 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/event/EventReceiver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EventReceiver.h 3 | * 4 | * Created on: 07.01.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef EVENTRECEIVER_H_ 9 | #define EVENTRECEIVER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class Event; 14 | 15 | class EventReceiver 16 | { 17 | 18 | friend class EventManager; 19 | 20 | private: 21 | 22 | virtual void activate() = 0; 23 | 24 | virtual void deactivate() = 0; 25 | 26 | virtual bool processEvent(const Event& event) = 0; 27 | 28 | public: 29 | 30 | EventReceiver() 31 | { 32 | } 33 | 34 | virtual ~EventReceiver() 35 | { 36 | } 37 | 38 | }; 39 | 40 | typedef std::shared_ptr EventReceiverSP; 41 | 42 | #endif /* EVENTRECEIVER_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBuffer.h 3 | * 4 | * Created on: 22.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef RENDERBUFFER_H_ 9 | #define RENDERBUFFER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class RenderBuffer 14 | { 15 | 16 | protected: 17 | 18 | GLenum internalFormat; 19 | 20 | std::int32_t width; 21 | std::int32_t height; 22 | 23 | GLuint rb; 24 | 25 | bool valid; 26 | 27 | public: 28 | RenderBuffer(GLenum internalFormat, std::int32_t width, std::int32_t height); 29 | virtual ~RenderBuffer(); 30 | 31 | virtual bool init(); 32 | void destroy(); 33 | 34 | virtual bool isMultisample() const; 35 | 36 | GLenum getInternalFormat() const; 37 | void setInternalFormat(GLenum internalFormat); 38 | 39 | std::int32_t getWidth() const; 40 | void setWidth(std::int32_t width); 41 | std::int32_t getHeight() const; 42 | void setHeight(std::int32_t height); 43 | 44 | void setWidthHeight(std::int32_t width, std::int32_t height); 45 | 46 | GLuint getRb() const; 47 | 48 | bool isValid() const; 49 | }; 50 | 51 | typedef std::shared_ptr RenderBufferSP; 52 | 53 | #endif /* RENDERBUFFER_H_ */ 54 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferFactory.cpp 3 | * 4 | * Created on: 27.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "RenderBufferFactory.h" 9 | 10 | using namespace std; 11 | 12 | RenderBufferFactory::RenderBufferFactory() 13 | { 14 | } 15 | 16 | RenderBufferFactory::~RenderBufferFactory() 17 | { 18 | } 19 | 20 | RenderBufferSP RenderBufferFactory::createRenderBuffer(GLenum internalFormat, int32_t width, int32_t height) const 21 | { 22 | return RenderBufferSP(new RenderBuffer(internalFormat, width, height)); 23 | } 24 | 25 | RenderBufferMultisampleSP RenderBufferFactory::createRenderBufferMultisample(int32_t samples, GLenum internalFormat, int32_t width, int32_t height) const 26 | { 27 | return RenderBufferMultisampleSP(new RenderBufferMultisample(samples, internalFormat, width, height)); 28 | } 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferFactory.h 3 | * 4 | * Created on: 27.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef RENDERBUFFERFACTORY_H_ 9 | #define RENDERBUFFERFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "RenderBuffer.h" 14 | #include "RenderBufferMultisample.h" 15 | 16 | class RenderBufferFactory 17 | { 18 | public: 19 | RenderBufferFactory(); 20 | virtual ~RenderBufferFactory(); 21 | 22 | RenderBufferSP createRenderBuffer(GLenum internalFormat, std::int32_t width, std::int32_t height) const; 23 | 24 | RenderBufferMultisampleSP createRenderBufferMultisample(std::int32_t samples, GLenum internalFormat, std::int32_t width, std::int32_t height) const; 25 | 26 | }; 27 | 28 | #endif /* RENDERBUFFERFACTORY_H_ */ 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferManager.h 3 | * 4 | * Created on: 27.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef RENDERBUFFERMANAGER_H_ 9 | #define RENDERBUFFERMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "RenderBuffer.h" 17 | 18 | class RenderBufferManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allRenderBuffers; 26 | 27 | RenderBufferManager(); 28 | virtual ~RenderBufferManager(); 29 | 30 | public: 31 | 32 | void addRenderBuffer(const std::string& key, const RenderBufferSP& renderBuffer); 33 | 34 | RenderBufferSP createRenderBuffer(const std::string& key, GLenum internalFormat, std::int32_t width, std::int32_t height); 35 | 36 | }; 37 | 38 | #endif /* RENDERBUFFERMANAGER_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferMultisample.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferMultisample.cpp 3 | * 4 | * Created on: 05.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "RenderBufferMultisample.h" 9 | 10 | using namespace std; 11 | 12 | RenderBufferMultisample::RenderBufferMultisample(int32_t samples, GLenum internalFormat, int32_t width, int32_t height) : 13 | RenderBuffer(internalFormat, width, height), samples(samples) 14 | { 15 | init(); 16 | } 17 | 18 | RenderBufferMultisample::~RenderBufferMultisample() 19 | { 20 | } 21 | 22 | bool RenderBufferMultisample::init() 23 | { 24 | if (width < 1 || height < 1) 25 | { 26 | return false; 27 | } 28 | 29 | if (!rb) 30 | { 31 | glGenRenderbuffers(1, &rb); 32 | 33 | if (!rb) 34 | { 35 | return false; 36 | } 37 | } 38 | 39 | glBindRenderbuffer(GL_RENDERBUFFER, rb); 40 | 41 | glGetError(); 42 | 43 | glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, internalFormat, width, height); 44 | 45 | valid = (glGetError() == GL_NO_ERROR); 46 | 47 | return valid; 48 | } 49 | 50 | bool RenderBufferMultisample::isMultisample() const 51 | { 52 | return samples > 0; 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferMultisample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferMultisample.h 3 | * 4 | * Created on: 05.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef RENDERBUFFERMULTISAMPLE_H_ 9 | #define RENDERBUFFERMULTISAMPLE_H_ 10 | 11 | #include "RenderBuffer.h" 12 | 13 | class RenderBufferMultisample : public RenderBuffer 14 | { 15 | 16 | private: 17 | 18 | std::int32_t samples; 19 | 20 | public: 21 | RenderBufferMultisample(std::int32_t samples, GLenum internalFormat, std::int32_t width, std::int32_t height); 22 | virtual ~RenderBufferMultisample(); 23 | 24 | virtual bool init(); 25 | 26 | virtual bool isMultisample() const; 27 | 28 | }; 29 | 30 | typedef std::shared_ptr RenderBufferMultisampleSP; 31 | 32 | #endif /* RENDERBUFFERMULTISAMPLE_H_ */ 33 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/renderbuffer/RenderBufferMultisampleManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RenderBufferMultisampleManager.h 3 | * 4 | * Created on: 05.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef RENDERBUFFERMULTISAMPLEMANAGER_H_ 9 | #define RENDERBUFFERMULTISAMPLEMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "RenderBufferMultisample.h" 17 | 18 | class RenderBufferMultisampleManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allRenderBuffers; 26 | 27 | RenderBufferMultisampleManager(); 28 | virtual ~RenderBufferMultisampleManager(); 29 | 30 | public: 31 | 32 | void addRenderBuffer(const std::string& key, const RenderBufferMultisampleSP& renderBufferMultisample); 33 | 34 | RenderBufferMultisampleSP createRenderBuffer(const std::string& key, std::int32_t samples, GLenum internalFormat, std::int32_t width, std::int32_t height); 35 | 36 | }; 37 | 38 | #endif /* RENDERBUFFERMULTISAMPLEMANAGER_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/ProgramFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ProgramFactory.h 3 | * 4 | * Created on: 05.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PROGRAMFACTORY_H_ 9 | #define PROGRAMFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "Program.h" 14 | 15 | class ProgramFactory 16 | { 17 | 18 | private: 19 | 20 | static std::string path; 21 | 22 | public: 23 | ProgramFactory(); 24 | virtual ~ProgramFactory(); 25 | 26 | static const std::string& getPath(); 27 | 28 | static void setPath(const std::string& path); 29 | 30 | ProgramSP createPhongProgram() const; 31 | 32 | ProgramSP createPhongRenderToCubeMapProgram() const; 33 | 34 | ProgramSP createPhongRenderToShadowMapProgram() const; 35 | 36 | ProgramSP createFontProgram() const; 37 | 38 | ProgramSP createPostProcess2DProgram() const; 39 | 40 | ProgramSP createLineGeometryProgram() const; 41 | 42 | ProgramSP createLineGeometryLinesProgram() const; 43 | 44 | ProgramSP createSkyProgram() const; 45 | 46 | ProgramSP createGroundProgram() const; 47 | 48 | ProgramSP createGroundRenderToCubeMapProgram() const; 49 | 50 | ProgramSP createGroundRenderToShadowMapProgram() const; 51 | 52 | }; 53 | 54 | #endif /* PROGRAMFACTORY_H_ */ 55 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/ProgramPipelineManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ProgramPipelineManager.h 3 | * 4 | * Created on: 06.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PROGRAMPIPELINEMANAGER_H_ 9 | #define PROGRAMPIPELINEMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/Singleton.h" 14 | 15 | #include "ProgramManager.h" 16 | #include "ProgramPipeline.h" 17 | 18 | class ProgramPipelineManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | std::multimap allProgramPipelines; 26 | 27 | private: 28 | 29 | ProgramPipelineManager(); 30 | virtual ~ProgramPipelineManager(); 31 | 32 | public: 33 | 34 | void addProgramPipeline(const ProgramPipelineSP& programPipeline); 35 | 36 | void removeProgramPipeline(const ProgramPipelineSP& programPipeline); 37 | 38 | ProgramPipelineSP getProgramPipelineBy(const std::string& name, const std::string& type = ProgramManager::DEFAULT_PROGRAM_TYPE) const; 39 | 40 | const std::multimap& getAllProgramPipelines() const; 41 | 42 | }; 43 | 44 | #endif /* PROGRAMPIPELINEMANAGER_H_ */ 45 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/ProgramSeparable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ProgramSeparable.h 3 | * 4 | * Created on: 27.05.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PROGRAMSEPARABLE_H_ 9 | #define PROGRAMSEPARABLE_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class ProgramSeparable 14 | { 15 | 16 | protected: 17 | 18 | GLUSprogram shaderprogram; 19 | 20 | GLUSenum shaderType; 21 | 22 | std::string filename; 23 | 24 | std::map allUniforms; 25 | std::map allAtribbs; 26 | 27 | bool includeShader(std::string& shaderSource) const; 28 | 29 | public: 30 | 31 | ProgramSeparable(const GLUSenum shaderType, const std::string& filename); 32 | virtual ~ProgramSeparable(); 33 | 34 | std::int32_t getUniformLocation(const std::string& name); 35 | std::int32_t getAttribLocation(const std::string& name); 36 | 37 | const GLUSuint getProgram() const; 38 | 39 | const GLUSenum getShaderType() const; 40 | 41 | const std::string& getFilename() const; 42 | 43 | }; 44 | 45 | typedef std::shared_ptr ProgramSeparableSP; 46 | 47 | #endif /* PROGRAMSEPARABLE_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/ProgramSeparableManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ProgramSeparableManager.cpp 3 | * 4 | * Created on: 06.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "ProgramSeparableManager.h" 9 | 10 | using namespace std; 11 | 12 | ProgramSeparableManager::ProgramSeparableManager() : 13 | Singleton(), allProgramSeparables() 14 | { 15 | } 16 | 17 | ProgramSeparableManager::~ProgramSeparableManager() 18 | { 19 | } 20 | 21 | void ProgramSeparableManager::addProgramSeparable(const ProgramSeparableSP& programSeparable) 22 | { 23 | allProgramSeparables.add(programSeparable->getFilename(), programSeparable); 24 | } 25 | 26 | void ProgramSeparableManager::removeProgramSeparable(const ProgramSeparableSP& programSeparable) 27 | { 28 | allProgramSeparables.remove(programSeparable->getFilename()); 29 | } 30 | 31 | ProgramSeparableSP ProgramSeparableManager::getProgramSeparableBy(const string& filename) const 32 | { 33 | return allProgramSeparables.search(filename); 34 | } 35 | 36 | const KeyValueMap& ProgramSeparableManager::getAllProgramSeparables() const 37 | { 38 | return allProgramSeparables; 39 | } 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/ProgramSeparableManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ProgramSeparableManager.h 3 | * 4 | * Created on: 06.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PROGRAMSEPARABLEMANAGER_H_ 9 | #define PROGRAMSEPARABLEMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "ProgramSeparable.h" 17 | 18 | class ProgramSeparableManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allProgramSeparables; 26 | 27 | private: 28 | 29 | ProgramSeparableManager(); 30 | virtual ~ProgramSeparableManager(); 31 | 32 | public: 33 | 34 | void addProgramSeparable(const ProgramSeparableSP& programSeparable); 35 | 36 | void removeProgramSeparable(const ProgramSeparableSP& programSeparable); 37 | 38 | ProgramSeparableSP getProgramSeparableBy(const std::string& filename) const; 39 | 40 | const KeyValueMap& getAllProgramSeparables() const; 41 | 42 | }; 43 | 44 | #endif /* PROGRAMSEPARABLEMANAGER_H_ */ 45 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/VAO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * VAO.cpp 3 | * 4 | * Created on: 27.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "GL/glus.h" 9 | 10 | #include "VAO.h" 11 | 12 | using namespace std; 13 | 14 | VAO::VAO(const ProgramSP& program) : 15 | program(program), vao(0) 16 | { 17 | } 18 | 19 | VAO::~VAO() 20 | { 21 | } 22 | 23 | void VAO::generateVAO() 24 | { 25 | glGenVertexArrays(1, &vao); 26 | bind(); 27 | } 28 | 29 | void VAO::deleteVAO() 30 | { 31 | unbind(); 32 | glDeleteVertexArrays(1, &vao); 33 | } 34 | 35 | void VAO::bind() const 36 | { 37 | glBindVertexArray(vao); 38 | } 39 | 40 | void VAO::unbind() const 41 | { 42 | glBindVertexArray(0); 43 | } 44 | 45 | const string& VAO::getProgramType() const 46 | { 47 | return program->getType(); 48 | } 49 | 50 | const ProgramSP& VAO::getProgram() const 51 | { 52 | return program; 53 | } 54 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/shader/VAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VAO.h 3 | * 4 | * Created on: 27.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef VAO_H_ 9 | #define VAO_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "Program.h" 14 | 15 | class VAO 16 | { 17 | 18 | protected: 19 | 20 | ProgramSP program; 21 | 22 | GLuint vao; 23 | 24 | protected: 25 | 26 | void generateVAO(); 27 | 28 | void deleteVAO(); 29 | 30 | public: 31 | 32 | VAO(const ProgramSP& program); 33 | virtual ~VAO(); 34 | 35 | void bind() const; 36 | 37 | void unbind() const; 38 | 39 | const std::string& getProgramType() const; 40 | 41 | const ProgramSP& getProgram() const; 42 | 43 | }; 44 | 45 | typedef std::shared_ptr VAOSP; 46 | 47 | #endif /* VAO_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture1D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture1D.h 3 | * 4 | * Created on: 20.12.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE1D_H_ 9 | #define TEXTURE1D_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class Texture1D: public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | PixelData pixelData; 20 | 21 | public: 22 | 23 | Texture1D(const std::string& identifier, float red); 24 | Texture1D(const std::string& identifier, const Color& color); 25 | Texture1D(const std::string& identifier, GLint internalFormat, std::int32_t width, GLenum format, GLenum type, const std::uint8_t* pixels, std::uint32_t sizeOfData, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 26 | virtual ~Texture1D(); 27 | 28 | virtual bool init(); 29 | 30 | virtual void freePixels(); 31 | 32 | }; 33 | 34 | typedef std::shared_ptr Texture1DSP; 35 | 36 | #endif /* TEXTURE1D_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture1DArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture1DArray.h 3 | * 4 | * Created on: 06.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE1DARRAY_H_ 9 | #define TEXTURE1DARRAY_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class Texture1DArray : public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | std::vector allPixelData; 20 | 21 | public: 22 | 23 | Texture1DArray(const std::string& identifier, GLint internalFormat, std::int32_t width, GLenum format, GLenum type, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 24 | virtual ~Texture1DArray(); 25 | 26 | virtual bool init(); 27 | 28 | virtual void freePixels(); 29 | 30 | bool addPixelData(const PixelDataSP& pixelData); 31 | 32 | }; 33 | 34 | typedef std::shared_ptr Texture1DArraySP; 35 | 36 | #endif /* TEXTURE1DARRAY_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture2D.h 3 | * 4 | * Created on: 22.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE2D_H_ 9 | #define TEXTURE2D_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class Texture2D : public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | PixelData pixelData; 20 | 21 | public: 22 | 23 | Texture2D(const std::string& identifier, float red); 24 | Texture2D(const std::string& identifier, const Color& color); 25 | Texture2D(const std::string& identifier, GLint internalFormat, std::int32_t width, std::int32_t height, GLenum format, GLenum type, const std::uint8_t* pixels, std::uint32_t sizeOfData, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 26 | virtual ~Texture2D(); 27 | 28 | virtual bool init(); 29 | 30 | virtual void freePixels(); 31 | 32 | const PixelData& getPixelData() const; 33 | 34 | }; 35 | 36 | typedef std::shared_ptr Texture2DSP; 37 | 38 | #endif /* TEXTURE2D_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture2DArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture2DArray.h 3 | * 4 | * Created on: 06.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE2DARRAY_H_ 9 | #define TEXTURE2DARRAY_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class Texture2DArray : public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | std::vector allPixelData; 20 | 21 | public: 22 | 23 | Texture2DArray(const std::string& identifier, GLint internalFormat, std::int32_t width, std::int32_t height, GLenum format, GLenum type, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 24 | virtual ~Texture2DArray(); 25 | 26 | virtual bool init(); 27 | 28 | virtual void freePixels(); 29 | 30 | bool addPixelData(const PixelDataSP& pixelData); 31 | 32 | }; 33 | 34 | typedef std::shared_ptr Texture2DArraySP; 35 | 36 | #endif /* TEXTURE2DARRAY_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture2DMultisample.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture2DMultisample.cpp 3 | * 4 | * Created on: 04.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "Texture2DMultisample.h" 9 | 10 | using namespace std; 11 | 12 | Texture2DMultisample::Texture2DMultisample(const string& identifier, int32_t samples, GLint internalFormat, int32_t width, int32_t height, bool fixedsamplelocations) : 13 | Texture(identifier, GL_TEXTURE_2D_MULTISAMPLE, internalFormat, width, height), samples(samples), fixedsamplelocations(fixedsamplelocations) 14 | { 15 | init(); 16 | } 17 | 18 | Texture2DMultisample::~Texture2DMultisample() 19 | { 20 | } 21 | 22 | void Texture2DMultisample::changingSize() 23 | { 24 | // Do nothing for now 25 | } 26 | 27 | bool Texture2DMultisample::init() 28 | { 29 | if (width < 1 || height < 1) 30 | { 31 | return false; 32 | } 33 | 34 | if (!textureName) 35 | { 36 | glGenTextures(1, &textureName); 37 | 38 | if (!textureName) 39 | { 40 | return false; 41 | } 42 | } 43 | 44 | glBindTexture(target, textureName); 45 | 46 | glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedsamplelocations); 47 | 48 | return true; 49 | } 50 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture2DMultisample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture2DMultisample.h 3 | * 4 | * Created on: 04.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE2DMULTISAMPLE_H_ 9 | #define TEXTURE2DMULTISAMPLE_H_ 10 | 11 | #include "Texture.h" 12 | 13 | class Texture2DMultisample : public Texture 14 | { 15 | 16 | protected: 17 | 18 | std::int32_t samples; 19 | 20 | bool fixedsamplelocations; 21 | 22 | virtual void changingSize(); 23 | 24 | public: 25 | Texture2DMultisample(const std::string& identifier, std::int32_t samples, GLint internalFormat, std::int32_t width, std::int32_t height, bool fixedsamplelocations = false); 26 | virtual ~Texture2DMultisample(); 27 | 28 | virtual bool init(); 29 | 30 | }; 31 | 32 | typedef std::shared_ptr Texture2DMultisampleSP; 33 | 34 | #endif /* TEXTURE2DMULTISAMPLE_H_ */ 35 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/Texture2DMultisampleManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Texture2DMultisampleManager.h 3 | * 4 | * Created on: 04.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURE2DMULTISAMPLEMANAGER_H_ 9 | #define TEXTURE2DMULTISAMPLEMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Texture2DMultisample.h" 17 | 18 | class Texture2DMultisampleManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allTextures; 26 | 27 | private: 28 | 29 | Texture2DMultisampleManager(); 30 | virtual ~Texture2DMultisampleManager(); 31 | 32 | public: 33 | 34 | void addTexture(const std::string& key, const Texture2DMultisampleSP& texture); 35 | 36 | Texture2DMultisampleSP createTexture(const std::string& key, std::int32_t samples, GLint internalFormat, std::int32_t width, std::int32_t height, bool fixedsamplelocations = false); 37 | 38 | }; 39 | 40 | #endif /* TEXTURE2DMULTISAMPLEMANAGER_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/TextureCubeMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TextureCubeMap.h 3 | * 4 | * Created on: 22.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURECUBEMAP_H_ 9 | #define TEXTURECUBEMAP_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class TextureCubeMap : public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | PixelData pixelData[6]; 20 | 21 | public: 22 | 23 | TextureCubeMap(const std::string& identifier, GLint internalFormat, std::int32_t width, std::int32_t height, GLenum format, GLenum type, const std::uint8_t* pixelsPosX, const std::uint8_t* pixelsNegX, const std::uint8_t* pixelsPosY, const std::uint8_t* pixelsNegY, const std::uint8_t* pixelsPosZ, const std::uint8_t* pixelsNegZ, std::uint32_t sizeOfData, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 24 | virtual ~TextureCubeMap(); 25 | 26 | virtual bool init(); 27 | 28 | virtual void freePixels(); 29 | 30 | const PixelData& getPixelData(std::int32_t index) const; 31 | 32 | }; 33 | 34 | typedef std::shared_ptr TextureCubeMapSP; 35 | 36 | #endif /* TEXTURECUBEMAP_H_ */ 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/TextureCubeMapArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TextureCubeMapArray.h 3 | * 4 | * Created on: 14.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef TEXTURECUBEMAPARRAY_H_ 9 | #define TEXTURECUBEMAPARRAY_H_ 10 | 11 | #include "PixelData.h" 12 | #include "TextureStandard.h" 13 | 14 | class TextureCubeMapArray : public TextureStandard 15 | { 16 | 17 | private: 18 | 19 | std::int32_t sizeOfArray; 20 | 21 | PixelDataSP pixelData; 22 | 23 | public: 24 | TextureCubeMapArray(const std::string& identifier, GLint internalFormat, std::int32_t width, std::int32_t height, GLenum format, GLenum type, const std::uint8_t* pixelsPos[], std::uint32_t sizeOfData, std::int32_t sizeOfArray, bool mipMap, GLint minFilter, GLint magFilter, GLint wrapS, GLint wrapT, float anisotropic); 25 | virtual ~TextureCubeMapArray(); 26 | 27 | virtual bool init(); 28 | 29 | virtual void freePixels(); 30 | 31 | const PixelData& getPixelData(std::int32_t index, std::int32_t arrayIndex) const; 32 | 33 | std::int32_t getSizeOfArray() const; 34 | 35 | }; 36 | 37 | typedef std::shared_ptr TextureCubeMapArraySP; 38 | 39 | #endif /* TEXTURECUBEMAPARRAY_H_ */ 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer1/texture/TextureFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TextureFactory.h 3 | * 4 | * Created on: 31.05.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef TEXTUREFACTORY_H_ 9 | #define TEXTUREFACTORY_H_ 10 | 11 | #ifndef GE_NO_DEVIL 12 | #include "TextureFactory_DevIL.h" 13 | #else 14 | #include "TextureFactory_GLUS.h" 15 | #endif 16 | 17 | #endif /* TEXTUREFACTORY_H_ */ 18 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/DebugDrawFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DebugDrawFactory.h 3 | * 4 | * Created on: 21.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DEBUGDRAWFACTORY_H_ 9 | #define DEBUGDRAWFACTORY_H_ 10 | 11 | class DebugDrawFactory 12 | { 13 | public: 14 | DebugDrawFactory(); 15 | virtual ~DebugDrawFactory(); 16 | 17 | void createDefaultDebugGeometry() const; 18 | }; 19 | 20 | #endif /* DEBUGDRAWFACTORY_H_ */ 21 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/GroundPlane.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundPlane.cpp 3 | * 4 | * Created on: 08.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "DebugDraw.h" 9 | 10 | #include "GroundPlane.h" 11 | 12 | GroundPlane::GroundPlane() : 13 | plane(Point4(), Vector3(0.0f, 1.0f, 0.0f)), origin() 14 | { 15 | } 16 | 17 | GroundPlane::GroundPlane(float elevation) : 18 | plane(Point4(0.0f, elevation, 0.0f), Vector3(0.0f, 1.0f, 0.0f)), origin() 19 | { 20 | } 21 | 22 | GroundPlane::~GroundPlane() 23 | { 24 | } 25 | 26 | void GroundPlane::draw(const Point4& eye, const Color& color) const 27 | { 28 | origin.setX(ceilf(eye.getX())); 29 | origin.setZ(floorf(eye.getZ())); 30 | 31 | DebugDraw::drawer.draw(plane, origin, color); 32 | } 33 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/GroundPlane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundPlane.h 3 | * 4 | * Created on: 08.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GROUNDPLANE_H_ 9 | #define GROUNDPLANE_H_ 10 | 11 | #include "../../layer0/math/Plane.h" 12 | #include "../../layer0/math/Point4.h" 13 | 14 | #include "../../UsedLibs.h" 15 | 16 | class GroundPlane 17 | { 18 | 19 | private: 20 | 21 | Plane plane; 22 | mutable Point4 origin; 23 | 24 | public: 25 | GroundPlane(); 26 | GroundPlane(float elevation); 27 | virtual ~GroundPlane(); 28 | 29 | void draw(const Point4& eye, const Color& color) const; 30 | 31 | }; 32 | 33 | #endif /* GROUNDPLANE_H_ */ 34 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/LineGeometryManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LineGeometryManager.cpp 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "LineGeometryManager.h" 9 | 10 | using namespace std; 11 | 12 | LineGeometryManager::LineGeometryManager() : 13 | Singleton() 14 | { 15 | } 16 | 17 | LineGeometryManager::~LineGeometryManager() { 18 | auto walker = allLineGeometries.begin(); 19 | while (walker != allLineGeometries.end()) 20 | { 21 | walker->second.reset(); 22 | walker++; 23 | } 24 | allLineGeometries.clear(); 25 | } 26 | 27 | bool LineGeometryManager::containsLineGeometry(const string& key) const 28 | { 29 | return allLineGeometries.contains(key); 30 | } 31 | 32 | const LineGeometrySP& LineGeometryManager::getLineGeometry(const string& key) const 33 | { 34 | return allLineGeometries.at(key); 35 | } 36 | 37 | void LineGeometryManager::setLineGeometry(const string& key, const LineGeometrySP& lineGeometry) 38 | { 39 | allLineGeometries[key] = lineGeometry; 40 | } 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/LineGeometryManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LineGeometryManager.h 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LINEGEOMETRYMANAGER_H_ 9 | #define LINEGEOMETRYMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "LineGeometry.h" 17 | 18 | class LineGeometryManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allLineGeometries; 26 | 27 | LineGeometryManager(); 28 | virtual ~LineGeometryManager(); 29 | 30 | public: 31 | 32 | bool containsLineGeometry(const std::string& key) const; 33 | 34 | const LineGeometrySP& getLineGeometry(const std::string& key) const; 35 | 36 | void setLineGeometry(const std::string& key, const LineGeometrySP& lineGeometry); 37 | 38 | }; 39 | 40 | #endif /* LINEGEOMETRYMANAGER_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/LineGeometryVAO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LineVAO.cpp 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer1/shader/Variables.h" 9 | #include "LineGeometry.h" 10 | 11 | #include "LineGeometryVAO.h" 12 | 13 | LineGeometryVAO::LineGeometryVAO(const ProgramSP& program, const LineGeometry& lineGeometry) : 14 | VAO(program) 15 | { 16 | generateVAO(); 17 | 18 | glBindBuffer(GL_ARRAY_BUFFER, lineGeometry.getVboVertices()); 19 | glVertexAttribPointer(program->getAttribLocation(a_vertex), 4, GL_FLOAT, GL_FALSE, 0, 0); 20 | glEnableVertexAttribArray(program->getAttribLocation(a_vertex)); 21 | 22 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, lineGeometry.getVboIndices()); 23 | 24 | glEnableVertexAttribArray(0); 25 | 26 | unbind(); 27 | } 28 | 29 | LineGeometryVAO::~LineGeometryVAO() 30 | { 31 | deleteVAO(); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/debug/LineGeometryVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LineGeometryVAO.h 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LINEGEOMETRYVAO_H_ 9 | #define LINEGEOMETRYVAO_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer1/shader/Program.h" 14 | #include "../../layer1/shader/VAO.h" 15 | 16 | class LineGeometry; 17 | 18 | class LineGeometryVAO : public VAO { 19 | public: 20 | LineGeometryVAO(const ProgramSP& program, const LineGeometry& lineGeometry); 21 | virtual ~LineGeometryVAO(); 22 | }; 23 | 24 | typedef std::shared_ptr LineGeometryVAOSP; 25 | 26 | #endif /* LINEGEOMETRYVAO_H_ */ 27 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkyDome.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SkyDome.cpp 3 | * 4 | * Created on: 11.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer0/primitive/DomeShape.h" 9 | 10 | #include "SkyDome.h" 11 | 12 | using namespace std; 13 | 14 | SkyDome::SkyDome(float radiusX, float radiusY, float radiusZ, const string& identifier, const string& posX, const string& negX, const string& posY, const string& negY, const string& posZ, const string& negZ) 15 | : Sky(DomeShape(1.0f, 32), radiusX, radiusY, radiusZ, identifier, posX, negX, posY, negY, posZ, negZ) 16 | { 17 | } 18 | 19 | SkyDome::SkyDome(float radiusX, float radiusY, float radiusZ, const string& filename) 20 | : Sky(DomeShape(1.0f, 32), radiusX, radiusY, radiusZ, filename) 21 | { 22 | } 23 | 24 | SkyDome::~SkyDome() 25 | { 26 | } 27 | 28 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkyDome.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SkyDome.h 3 | * 4 | * Created on: 11.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SKYDOME_H_ 9 | #define SKYDOME_H_ 10 | 11 | #include "Sky.h" 12 | 13 | class SkyDome: public Sky 14 | { 15 | 16 | public: 17 | 18 | SkyDome(float radiusX, float radiusY, float radiusZ, const std::string& identifier, const std::string& posX, const std::string& negX, const std::string& posY, const std::string& negY, const std::string& posZ, const std::string& negZ); 19 | SkyDome(float radiusX, float radiusY, float radiusZ, const std::string& filename); 20 | virtual ~SkyDome(); 21 | 22 | }; 23 | 24 | #endif /* SKYDOME_H_ */ 25 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkyManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SkyManager.h 3 | * 4 | * Created on: 18.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SKYMANAGER_H_ 9 | #define SKYMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Sky.h" 17 | 18 | class SkyManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allSkies; 26 | 27 | SkySP activeSky; 28 | 29 | protected: 30 | 31 | SkyManager(); 32 | virtual ~SkyManager(); 33 | 34 | public: 35 | 36 | const SkySP& getSky(const std::string& key) const; 37 | 38 | void setSky(const std::string& key, const SkySP& sky); 39 | 40 | const SkySP& getActiveSky() const; 41 | 42 | void setActiveSky(const std::string& key); 43 | 44 | void resetActiveSky(); 45 | 46 | bool hasActiveSky() const; 47 | 48 | void setBrightColorEffect(bool writeBrightColor, float brightColorLimit) const; 49 | 50 | }; 51 | 52 | #endif /* SKYMANAGER_H_ */ 53 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkySphere.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SkySphere.cpp 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer0/primitive/SphereShape.h" 9 | 10 | #include "SkySphere.h" 11 | 12 | using namespace std; 13 | 14 | SkySphere::SkySphere(float radiusX, float radiusY, float radiusZ, const string& identifier, const string& posX, const string& negX, const string& posY, const string& negY, const string& posZ, const string& negZ) 15 | : Sky(SphereShape(1.0f, 32), radiusX, radiusY, radiusZ, identifier, posX, negX, posY, negY, posZ, negZ) 16 | { 17 | } 18 | 19 | SkySphere::SkySphere(float radiusX, float radiusY, float radiusZ, const string& filename) 20 | : Sky(SphereShape(1.0f, 32), radiusX, radiusY, radiusZ, filename) 21 | { 22 | } 23 | 24 | SkySphere::~SkySphere() 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkySphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SkySphere.h 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SKYSPHERE_H_ 9 | #define SKYSPHERE_H_ 10 | 11 | #include "Sky.h" 12 | 13 | class SkySphere : public Sky 14 | { 15 | 16 | public: 17 | 18 | SkySphere(float radiusX, float radiusY, float radiusZ, const std::string& identifier, const std::string& posX, const std::string& negX, const std::string& posY, const std::string& negY, const std::string& posZ, const std::string& negZ); 19 | SkySphere(float radiusX, float radiusY, float radiusZ, const std::string& filename); 20 | virtual ~SkySphere(); 21 | }; 22 | 23 | #endif /* SKYSPHERE_H_ */ 24 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkyVAO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SkyVAO.cpp 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer1/shader/Variables.h" 9 | #include "Sky.h" 10 | 11 | #include "SkyVAO.h" 12 | 13 | SkyVAO::SkyVAO(const ProgramSP& program, const Sky& sky) : VAO(program) 14 | { 15 | generateVAO(); 16 | 17 | glBindBuffer(GL_ARRAY_BUFFER, sky.getVboVertices()); 18 | glVertexAttribPointer(program->getAttribLocation(a_vertex), 4, GL_FLOAT, GL_FALSE, 0, 0); 19 | glEnableVertexAttribArray(program->getAttribLocation(a_vertex)); 20 | 21 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, sky.getVboIndices()); 22 | 23 | glEnableVertexAttribArray(0); 24 | 25 | unbind(); 26 | } 27 | 28 | SkyVAO::~SkyVAO() 29 | { 30 | deleteVAO(); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/environment/SkyVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SkyVAO.h 3 | * 4 | * Created on: 07.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SKYVAO_H_ 9 | #define SKYVAO_H_ 10 | 11 | #include "../../layer1/shader/Program.h" 12 | #include "../../layer1/shader/VAO.h" 13 | 14 | class Sky; 15 | 16 | class SkyVAO : public VAO 17 | { 18 | public: 19 | SkyVAO(const ProgramSP& program, const Sky& sky); 20 | virtual ~SkyVAO(); 21 | }; 22 | 23 | typedef std::shared_ptr SkyVAOSP; 24 | 25 | #endif /* SKYVAO_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/framebuffer/FrameBufferCubeMapManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FrameBufferCubeMapManager.h 3 | * 4 | * Created on: 21.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FRAMEBUFFERCUBEMAPMANAGER_H_ 9 | #define FRAMEBUFFERCUBEMAPMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "FrameBufferCubeMap.h" 17 | 18 | class FrameBufferCubeMapManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allFrameBuffers; 26 | 27 | FrameBufferCubeMapManager(); 28 | virtual ~FrameBufferCubeMapManager(); 29 | 30 | public: 31 | 32 | bool containsFrameBuffer(const std::string& key) const; 33 | 34 | const FrameBufferCubeMapSP& getFrameBuffer(const std::string& key) const; 35 | 36 | void addFrameBuffer(const std::string& key, const FrameBufferCubeMapSP& framBufferCubeMap); 37 | 38 | FrameBufferCubeMapSP createFrameBuffer(const std::string& key, std::int32_t width, std::int32_t height); 39 | 40 | }; 41 | 42 | #endif /* FRAMEBUFFERCUBEMAPMANAGER_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/ground/GroundFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundFactory.cpp 3 | * 4 | * Created on: 18.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer0/math/Point4.h" 9 | #include "../../layer0/primitive/GridPlaneShape.h" 10 | #include "../../layer1/collision/BoundingSphere.h" 11 | 12 | #include "GroundFactory.h" 13 | 14 | using namespace std; 15 | 16 | GroundFactory::GroundFactory() 17 | { 18 | } 19 | 20 | GroundFactory::~GroundFactory() 21 | { 22 | } 23 | 24 | GroundSP GroundFactory::createGround(float horizontalExtend, float verticalExtend, uint32_t rows, uint32_t columns) const 25 | { 26 | float radius = glusMathLengthf(horizontalExtend / 2.0f, verticalExtend / 2.0f, 0.0f); 27 | 28 | BoundingSphere boundingSphere(Point4(), radius); 29 | 30 | GridPlaneShape gridPlaneShape(horizontalExtend, verticalExtend, rows, columns); 31 | 32 | return GroundSP(new Ground(boundingSphere, gridPlaneShape)); 33 | } 34 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/ground/GroundFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundFactory.h 3 | * 4 | * Created on: 18.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GROUNDFACTORY_H_ 9 | #define GROUNDFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "Ground.h" 14 | 15 | class GroundFactory 16 | { 17 | 18 | public: 19 | 20 | GroundFactory(); 21 | virtual ~GroundFactory(); 22 | 23 | GroundSP createGround(float horizontalExtend, float verticalExtend, std::uint32_t rows, std::uint32_t columns) const; 24 | 25 | }; 26 | 27 | #endif /* GROUNDFACTORY_H_ */ 28 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/ground/GroundManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundManager.cpp 3 | * 4 | * Created on: 18.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "GroundManager.h" 9 | 10 | using namespace std; 11 | 12 | GroundManager::GroundManager() : 13 | Singleton(), allGrounds() 14 | { 15 | } 16 | 17 | GroundManager::~GroundManager() 18 | { 19 | auto walker = allGrounds.begin(); 20 | while (walker != allGrounds.end()) 21 | { 22 | walker->second.reset(); 23 | walker++; 24 | } 25 | allGrounds.clear(); 26 | } 27 | 28 | bool GroundManager::containsGroundByKey(const string& key) const 29 | { 30 | return allGrounds.contains(key); 31 | } 32 | 33 | const GroundSP& GroundManager::getGroundByKey(const string& key) const 34 | { 35 | return allGrounds.at(key); 36 | } 37 | 38 | void GroundManager::setGround(const string& key, const GroundSP& ground) 39 | { 40 | allGrounds[key] = ground; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/ground/GroundManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundManager.h 3 | * 4 | * Created on: 18.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GROUNDMANAGER_H_ 9 | #define GROUNDMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Ground.h" 17 | 18 | class GroundManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allGrounds; 26 | 27 | GroundManager(); 28 | virtual ~GroundManager(); 29 | 30 | public: 31 | 32 | bool containsGroundByKey(const std::string& key) const; 33 | 34 | const GroundSP& getGroundByKey(const std::string& key) const; 35 | 36 | void setGround(const std::string& key, const GroundSP& ground); 37 | 38 | }; 39 | 40 | #endif /* GROUNDMANAGER_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/ground/GroundVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundVAO.h 3 | * 4 | * Created on: 17.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GROUNDVAO_H_ 9 | #define GROUNDVAO_H_ 10 | 11 | #include "../../layer1/shader/Program.h" 12 | #include "../../layer1/shader/VAO.h" 13 | 14 | class Ground; 15 | 16 | class GroundVAO : public VAO 17 | { 18 | 19 | public: 20 | 21 | GroundVAO(const ProgramSP& program, const Ground& ground); 22 | virtual ~GroundVAO(); 23 | 24 | void update(const Ground& ground) const; 25 | 26 | }; 27 | 28 | typedef std::shared_ptr GroundVAOSP; 29 | 30 | #endif /* GROUNDVAO_H_ */ 31 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/interpolation/ConstantInterpolator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ConstantInterpolator.cpp 3 | * 4 | * Created on: 31.08.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer0/stl/Helper.h" 9 | 10 | #include "ConstantInterpolator.h" 11 | 12 | using namespace std; 13 | 14 | const ConstantInterpolator ConstantInterpolator::interpolator = ConstantInterpolator(); 15 | 16 | ConstantInterpolator::ConstantInterpolator() : 17 | Interpolator("CONSTANT", 0) 18 | { 19 | } 20 | 21 | ConstantInterpolator::~ConstantInterpolator() 22 | { 23 | } 24 | 25 | float ConstantInterpolator::interpolate(const map& table, float time) const 26 | { 27 | if (table.size() == 0) 28 | { 29 | return 0.0f; 30 | } 31 | 32 | auto walker = less_equal_bound(table, time); 33 | 34 | if (walker == table.end()) 35 | { 36 | return table.begin()->second; 37 | } 38 | 39 | return walker->second; 40 | } 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/interpolation/ConstantInterpolator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ConstantInterpolator.h 3 | * 4 | * Created on: 31.08.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CONSTANTINTERPOLATOR_H_ 9 | #define CONSTANTINTERPOLATOR_H_ 10 | 11 | #include "Interpolator.h" 12 | 13 | class ConstantInterpolator : public Interpolator 14 | { 15 | 16 | private: 17 | 18 | ConstantInterpolator(); 19 | virtual ~ConstantInterpolator(); 20 | 21 | public: 22 | 23 | static const ConstantInterpolator interpolator; 24 | 25 | virtual float interpolate(const std::map& table, float time) const; 26 | 27 | }; 28 | 29 | #endif /* CONSTANTINTERPOLATOR_H_ */ 30 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/interpolation/CubicInterpolator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CubicInterpolator.h 3 | * 4 | * Created on: 31.08.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CUBICINTERPOLATOR_H_ 9 | #define CUBICINTERPOLATOR_H_ 10 | 11 | #include "Interpolator.h" 12 | 13 | class CubicInterpolator : public Interpolator 14 | { 15 | 16 | private: 17 | 18 | CubicInterpolator(); 19 | virtual ~CubicInterpolator(); 20 | 21 | public: 22 | 23 | static const CubicInterpolator interpolator; 24 | 25 | virtual float interpolate(const std::map& table, float time) const; 26 | 27 | }; 28 | 29 | #endif /* CUBICINTERPOLATOR_H_ */ 30 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/interpolation/Interpolator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Interpolator.h 3 | * 4 | * Created on: 31.08.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef INTERPOLATOR_H_ 9 | #define INTERPOLATOR_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class Interpolator 14 | { 15 | 16 | private: 17 | 18 | std::string name; 19 | 20 | std::int32_t id; 21 | 22 | protected: 23 | 24 | Interpolator(const std::string& name, std::int32_t id) : name(name), id(id) 25 | { 26 | 27 | } 28 | 29 | virtual ~Interpolator() 30 | { 31 | 32 | } 33 | 34 | public: 35 | 36 | virtual float interpolate(const std::map& table, float time) const = 0; 37 | 38 | const std::string& getName() const 39 | { 40 | return name; 41 | } 42 | 43 | std::int32_t getId() const 44 | { 45 | return id; 46 | } 47 | 48 | }; 49 | 50 | #endif /* INTERPOLATOR_H_ */ 51 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/interpolation/LinearInterpolator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LinearInterpolator.h 3 | * 4 | * Created on: 31.08.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LINEARINTERPOLATOR_H_ 9 | #define LINEARINTERPOLATOR_H_ 10 | 11 | #include "Interpolator.h" 12 | 13 | class LinearInterpolator : public Interpolator 14 | { 15 | 16 | private: 17 | 18 | LinearInterpolator(); 19 | 20 | virtual ~LinearInterpolator(); 21 | 22 | public: 23 | 24 | static const LinearInterpolator interpolator; 25 | 26 | virtual float interpolate(const std::map& table, float time) const; 27 | 28 | }; 29 | 30 | #endif /* LINEARINTERPOLATOR_H_ */ 31 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer2/material/RefractiveIndices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RefractiveIndices.h 3 | * 4 | * Created on: 02.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | // Source http://en.wikipedia.org/wiki/List_of_refractive_indices 9 | 10 | #ifndef REFRACTIVEINDICES_H_ 11 | #define REFRACTIVEINDICES_H_ 12 | 13 | #define RI_NOTHING 0.0f 14 | 15 | #define RI_VACUUM 1.0f 16 | #define RI_AIR 1.000293f 17 | 18 | #define RI_ICE 1.31f 19 | #define RI_WATER 1.3330f 20 | 21 | #define RI_HUMAN_CORNEA_LOW 1.373f 22 | #define RI_HUMAN_CORNEA_HIGH 1.401f 23 | #define RI_HUMAN_LENSE_LOW 1.386f 24 | #define RI_HUMAN_LENSE_HIGH 1.406f 25 | 26 | #define RI_CROWN_GLASS_PURE_LOW 1.50f 27 | #define RI_CROWN_GLASS_PURE_HIGH 1.54f 28 | #define RI_FLINT_GLASS_PURE_LOW 1.60f 29 | #define RI_FLINT_GLASS_PURE_HIGH 1.62f 30 | #define RI_CROWN_GLASS_IMPURE_LOW 1.485f 31 | #define RI_CROWN_GLASS_IMPURE_HIGH 1.755f 32 | #define RI_FLINT_GLASS_IMPURE_LOW 1.523f 33 | #define RI_FLINT_GLASS_IMPURE_HIGH 1.925f 34 | 35 | #define RI_AMBER 1.55f 36 | #define RI_SAPPHIRE_LOW 1.762f 37 | #define RI_SAPPHIRE_HIGH 1.778f 38 | #define RI_DIAMOND 2.419f 39 | 40 | #endif /* REFRACTIVEINDICES_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/animation/AnimationStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AnimationStack.h 3 | * 4 | * Created on: 16.07.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ANIMATIONSTACK_H_ 9 | #define ANIMATIONSTACK_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "AnimationLayer.h" 14 | 15 | class AnimationStack 16 | { 17 | 18 | private: 19 | 20 | std::string name; 21 | 22 | float startTime; 23 | float stopTime; 24 | 25 | std::vector allAnimationLayers; 26 | 27 | public: 28 | AnimationStack(const std::string& name, float startTime, float stopTime); 29 | virtual ~AnimationStack(); 30 | 31 | void addAnimationLayer(const AnimationLayerSP& animationLayer); 32 | 33 | std::int32_t getAnimationLayersCount() const; 34 | 35 | const AnimationLayerSP& getAnimationLayer(std::int32_t index) const; 36 | 37 | const std::string& getName() const; 38 | 39 | float getStartTime() const; 40 | 41 | float getStopTime() const; 42 | }; 43 | 44 | typedef std::shared_ptr AnimationStackSP; 45 | 46 | #endif /* ANIMATIONSTACK_H_ */ 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/camera/OrthographicCamera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OrthographicCamera.h 3 | * 4 | * Created on: 14.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ORTHOGRAPHICCAMERA_H_ 9 | #define ORTHOGRAPHICCAMERA_H_ 10 | 11 | #include "Camera.h" 12 | 13 | class OrthographicCamera : public Camera 14 | { 15 | public: 16 | OrthographicCamera(const std::string& name); 17 | OrthographicCamera(const OrthographicCamera& other); 18 | virtual ~OrthographicCamera(); 19 | 20 | virtual void updateProjectionMatrix(); 21 | 22 | virtual float getNearWidth() const; 23 | 24 | virtual float getNearHeight() const; 25 | 26 | virtual float getFarWidth() const; 27 | 28 | virtual float getFarHeight() const; 29 | 30 | void orthographic(const Viewport& viewport, float zNear, float zFar); 31 | 32 | void orthographic(float width, float height, float zNear, float zFar); 33 | 34 | void adjustToFrustum(const ViewFrustum& viewFrustum, std::int32_t section, const Point4& lightPosition, const Quaternion& lightRotation); 35 | 36 | }; 37 | 38 | typedef std::shared_ptr OrthographicCameraSP; 39 | 40 | #endif /* ORTHOGRAPHICCAMERA_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/camera/PerspectiveCamera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PerspectiveCamera.h 3 | * 4 | * Created on: 14.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PERSPECTIVECAMERA_H_ 9 | #define PERSPECTIVECAMERA_H_ 10 | 11 | #include "Camera.h" 12 | 13 | class PerspectiveCamera : public Camera 14 | { 15 | 16 | private: 17 | 18 | float fovx; 19 | 20 | float fovy; 21 | 22 | bool fovxDirty; 23 | 24 | bool fovyDirty; 25 | 26 | public: 27 | PerspectiveCamera(const std::string& name); 28 | PerspectiveCamera(const PerspectiveCamera& other); 29 | virtual ~PerspectiveCamera(); 30 | 31 | virtual void updateProjectionMatrix(); 32 | 33 | virtual float getNearWidth() const; 34 | 35 | virtual float getNearHeight() const; 36 | 37 | virtual float getFarWidth() const; 38 | 39 | virtual float getFarHeight() const; 40 | 41 | void perspective(float fovy, const Viewport& viewport, float zNear, float zFar); 42 | 43 | void perspective(float fovy, float width, float height, float zNear, float zFar); 44 | 45 | void setFovx(float fovx); 46 | 47 | void setFovy(float fovy); 48 | }; 49 | 50 | typedef std::shared_ptr PerspectiveCameraSP; 51 | 52 | #endif /* PERSPECTIVECAMERA_H_ */ 53 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/camera/Viewport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Viewport.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef VIEWPORT_H_ 9 | #define VIEWPORT_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class Viewport 14 | { 15 | 16 | private: 17 | 18 | std::int32_t x; 19 | std::int32_t y; 20 | std::int32_t width; 21 | std::int32_t height; 22 | 23 | public: 24 | 25 | Viewport(); 26 | Viewport(std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height); 27 | Viewport(const Viewport& other); 28 | virtual ~Viewport(); 29 | 30 | void setViewport(std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height); 31 | 32 | void use() const; 33 | 34 | std::int32_t getX() const; 35 | std::int32_t getY() const; 36 | std::int32_t getWidth() const; 37 | std::int32_t getHeight() const; 38 | 39 | }; 40 | 41 | typedef std::shared_ptr ViewportSP; 42 | 43 | #endif /* VIEWPORT_H_ */ 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/camera/ViewportManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ViewportManager.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef VIEWPORTMANAGER_H_ 9 | #define VIEWPORTMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Viewport.h" 17 | 18 | class ViewportManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allViewports; 26 | 27 | public: 28 | 29 | static const std::string DEFAULT_VIEWPORT_KEY; 30 | 31 | private: 32 | 33 | ViewportManager(); 34 | virtual ~ViewportManager(); 35 | 36 | public: 37 | 38 | const ViewportSP& getDefaultViewport() const; 39 | 40 | bool containsViewport(const std::string& key) const; 41 | 42 | const ViewportSP& getViewport(const std::string& key) const; 43 | 44 | void setViewport(const std::string& key, const ViewportSP& viewport); 45 | 46 | }; 47 | 48 | #endif /* VIEWPORTMANAGER_H_ */ 49 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/light/DirectionalLight.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DirectionalLight.h 3 | * 4 | * Created on: 24.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DIRECTIONALLIGHT_H_ 9 | #define DIRECTIONALLIGHT_H_ 10 | 11 | #include "../../layer0/math/Vector3.h" 12 | 13 | #include "Light.h" 14 | 15 | class DirectionalLight: public Light 16 | { 17 | 18 | protected: 19 | 20 | Vector3 direction; 21 | 22 | public: 23 | DirectionalLight(const std::string& name, const Color& diffuse, 24 | const Color& specular); 25 | virtual ~DirectionalLight(); 26 | 27 | virtual void setLightProperties(std::uint32_t lightNumber, const ProgramSP& program, const Point4& position, const Quaternion& rotation) const; 28 | 29 | virtual void debugDraw(const Point4& position, const Quaternion& rotation) const; 30 | 31 | virtual std::int32_t getShadowType() const; 32 | 33 | }; 34 | 35 | typedef std::shared_ptr DirectionalLightSP; 36 | 37 | #endif /* DIRECTIONALLIGHT_H_ */ 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/light/Light.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Light.cpp 3 | * 4 | * Created on: 24.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "Light.h" 9 | 10 | using namespace std; 11 | 12 | const float Light::getDebugRadius() 13 | { 14 | return 2.0f; 15 | } 16 | 17 | Light::Light(const string& name, const Color& diffuse, const Color& specular) : 18 | name(name), diffuse(diffuse), specular(specular) 19 | { 20 | } 21 | 22 | Light::~Light() 23 | { 24 | } 25 | 26 | const string& Light::getName() const 27 | { 28 | return name; 29 | } 30 | 31 | const Color& Light::getDiffuse() const 32 | { 33 | return diffuse; 34 | } 35 | 36 | void Light::setDiffuse(const Color& diffuse) 37 | { 38 | this->diffuse = diffuse; 39 | } 40 | 41 | const Color& Light::getSpecular() const 42 | { 43 | return specular; 44 | } 45 | 46 | void Light::setSpecular(const Color& specular) 47 | { 48 | this->specular = specular; 49 | } 50 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/light/LightManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LightManager.h 3 | * 4 | * Created on: 24.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LIGHTMANAGER_H_ 9 | #define LIGHTMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Light.h" 17 | 18 | class LightManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allLights; 26 | 27 | Color ambientLightColor; 28 | 29 | LightManager(); 30 | virtual ~LightManager(); 31 | 32 | public: 33 | 34 | static const std::string DEFAULT_DIRECTIONAL_LIGHT_KEY; 35 | 36 | bool containsLight(const std::string& key) const; 37 | 38 | const LightSP& getLight(const std::string& key) const; 39 | 40 | const LightSP& getDefaultDirectionalLight() const; 41 | 42 | void setLight(const std::string& key, const LightSP& light); 43 | 44 | const Color& getAmbientLightColor() const; 45 | 46 | void setAmbientLightColor(const Color& ambientLightColor); 47 | 48 | }; 49 | 50 | #endif /* LIGHTMANAGER_H_ */ 51 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/mesh/MeshFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MeshFactory.cpp 3 | * 4 | * Created on: 04.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer1/shader/Program.h" 9 | #include "../../layer1/shader/ProgramManager.h" 10 | #include "../../layer2/material/SurfaceMaterialFactory.h" 11 | #include "SubMeshVAO.h" 12 | 13 | #include "MeshFactory.h" 14 | 15 | using namespace std; 16 | 17 | MeshFactory::MeshFactory() 18 | { 19 | } 20 | 21 | MeshFactory::~MeshFactory() 22 | { 23 | } 24 | 25 | MeshSP MeshFactory::createMesh(const string& name, const GLUSshape& shape, const SurfaceMaterialSP& surfaceMaterial) const 26 | { 27 | SurfaceMaterialFactory surfaceMaterialFactory; 28 | 29 | std::map subMeshes; 30 | subMeshes[0] = SubMeshSP(new SubMesh(0, shape.numberIndices / 3)); 31 | 32 | std::map surfaceMaterials; 33 | surfaceMaterials[0] = surfaceMaterial; 34 | 35 | MeshSP mesh = MeshSP(new Mesh(name, shape.numberVertices, shape.vertices, shape.normals, shape.bitangents, shape.tangents, shape.texCoords, shape.numberIndices, shape.indices, subMeshes, surfaceMaterials)); 36 | 37 | return mesh; 38 | } 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/mesh/MeshFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MeshFactory.h 3 | * 4 | * Created on: 04.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef MESHFACTORY_H_ 9 | #define MESHFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/color/Color.h" 14 | #include "../../layer2/material/SurfaceMaterial.h" 15 | #include "Mesh.h" 16 | #include "SubMesh.h" 17 | 18 | class MeshFactory 19 | { 20 | 21 | public: 22 | 23 | MeshFactory(); 24 | virtual ~MeshFactory(); 25 | 26 | MeshSP createMesh(const std::string& name, const GLUSshape& shape, const SurfaceMaterialSP& surfaceMaterial) const; 27 | 28 | }; 29 | 30 | #endif /* MESHFACTORY_H_ */ 31 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/mesh/SubMesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SubMesh.cpp 3 | * 4 | * Created on: 29.05.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "SubMesh.h" 9 | 10 | using namespace std; 11 | 12 | SubMesh::SubMesh(uint32_t indicesOffset, uint32_t triangleCount) : 13 | indicesOffset(indicesOffset), triangleCount(triangleCount), allVAOs() 14 | { 15 | } 16 | 17 | SubMesh::~SubMesh() 18 | { 19 | map::iterator walker = allVAOs.begin(); 20 | while (walker != allVAOs.end()) 21 | { 22 | walker->second.reset(); 23 | 24 | walker++; 25 | } 26 | allVAOs.clear(); 27 | } 28 | 29 | uint32_t SubMesh::getIndicesOffset() const 30 | { 31 | return indicesOffset; 32 | } 33 | 34 | uint32_t SubMesh::getTriangleCount() const 35 | { 36 | return triangleCount; 37 | } 38 | 39 | void SubMesh::addVAO(const SubMeshVAOSP& vao) 40 | { 41 | allVAOs[vao->getProgramType()] = vao; 42 | } 43 | 44 | bool SubMesh::containsVAOByProgramType(const string& type) const 45 | { 46 | return allVAOs.find(type) != allVAOs.end(); 47 | } 48 | 49 | const SubMeshVAOSP& SubMesh::getVAOByProgramType(const string& type) const 50 | { 51 | return allVAOs.at(type); 52 | } 53 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/mesh/SubMesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SubMesh.h 3 | * 4 | * Created on: 29.05.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef SUBMESH_H_ 9 | #define SUBMESH_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "SubMeshVAO.h" 14 | 15 | class SubMesh 16 | { 17 | 18 | friend class Mesh; 19 | friend class MeshFactory; 20 | 21 | private: 22 | 23 | std::uint32_t indicesOffset; 24 | std::uint32_t triangleCount; 25 | 26 | std::map allVAOs; 27 | 28 | void addVAO(const SubMeshVAOSP& vao); 29 | 30 | public: 31 | 32 | SubMesh(std::uint32_t indicesOffset, std::uint32_t triangleCount); 33 | 34 | virtual ~SubMesh(); 35 | 36 | std::uint32_t getIndicesOffset() const; 37 | 38 | std::uint32_t getTriangleCount() const; 39 | 40 | bool containsVAOByProgramType(const std::string& type) const; 41 | 42 | const SubMeshVAOSP& getVAOByProgramType(const std::string& type) const; 43 | 44 | }; 45 | 46 | typedef std::shared_ptr SubMeshSP; 47 | 48 | #endif /* SUBMESH_H_ */ 49 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/mesh/SubMeshVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SubMeshVAO.h 3 | * 4 | * Created on: 28.05.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef SUBMESHVAO_H_ 9 | #define SUBMESHVAO_H_ 10 | 11 | #include "../../layer1/shader/Program.h" 12 | #include "../../layer1/shader/VAO.h" 13 | 14 | class Mesh; 15 | 16 | class SubMeshVAO : public VAO 17 | { 18 | public: 19 | SubMeshVAO(const ProgramSP& program, const Mesh& mesh); 20 | virtual ~SubMeshVAO(); 21 | 22 | void update(const Mesh& mesh) const; 23 | 24 | }; 25 | 26 | typedef std::shared_ptr SubMeshVAOSP; 27 | 28 | #endif /* SUBMESHVAO_H_ */ 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer3/shadow/ShadowMap2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ShadowMap2S.h 3 | * 4 | * Created on: 06.06.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef SHADOWMAP2D_H_ 9 | #define SHADOWMAP2D_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer1/texture/Texture2DArray.h" 14 | #include "../../layer2/framebuffer/FrameBuffer2D.h" 15 | 16 | class ShadowMap2D 17 | { 18 | 19 | private: 20 | 21 | std::int32_t size; 22 | 23 | Texture2DArraySP depthTexture2D; 24 | 25 | std::vector allShadowMaps; 26 | 27 | public: 28 | 29 | ShadowMap2D(std::int32_t size, std::int32_t number); 30 | 31 | virtual ~ShadowMap2D(); 32 | 33 | bool use(bool enable, std::int32_t element) const; 34 | 35 | GLuint getDepthTextureName() const; 36 | 37 | std::int32_t getSize() const; 38 | 39 | }; 40 | 41 | typedef std::shared_ptr ShadowMap2DSP; 42 | 43 | #endif /* SHADOWMAP2D_H_ */ 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/entity/EntityList.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EntityList.cpp 3 | * 4 | * Created on: 04.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "EntityList.h" 9 | 10 | using namespace std; 11 | 12 | EntityList::EntityList() : 13 | allEntities() 14 | { 15 | } 16 | 17 | EntityList::~EntityList() 18 | { 19 | allEntities.clear(); 20 | } 21 | 22 | void EntityList::addEntity(const EntitySP& entity) 23 | { 24 | if (!containsEntity(entity)) 25 | { 26 | allEntities.push_back(entity); 27 | } 28 | } 29 | 30 | void EntityList::removeEntity(const EntitySP& entity) 31 | { 32 | auto walker = find(allEntities.begin(), allEntities.end(), entity); 33 | 34 | if (walker != allEntities.end()) 35 | { 36 | allEntities.erase(walker); 37 | } 38 | } 39 | 40 | bool EntityList::containsEntity(const EntitySP& entity) const 41 | { 42 | auto walker = find(allEntities.begin(), allEntities.end(), entity); 43 | 44 | return walker != allEntities.end(); 45 | } 46 | 47 | int32_t EntityList::size() const 48 | { 49 | return allEntities.size(); 50 | } 51 | 52 | void EntityList::clear() 53 | { 54 | allEntities.clear(); 55 | } 56 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/entity/EntityList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EntityList.h 3 | * 4 | * Created on: 04.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ENTITYLIST_H_ 9 | #define ENTITYLIST_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "Entity.h" 14 | 15 | class EntityList 16 | { 17 | 18 | private: 19 | 20 | std::vector allEntities; 21 | 22 | public: 23 | 24 | EntityList(); 25 | 26 | virtual ~EntityList(); 27 | 28 | void addEntity(const EntitySP& entity); 29 | 30 | void removeEntity(const EntitySP& entity); 31 | 32 | bool containsEntity(const EntitySP& entity) const; 33 | 34 | std::int32_t size() const; 35 | 36 | void clear(); 37 | 38 | }; 39 | 40 | typedef std::shared_ptr EntityListSP; 41 | 42 | #endif /* ENTITYLIST_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FontFactory.cpp 3 | * 4 | * Created on: 21.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "Font.h" 9 | #include "FontManager.h" 10 | 11 | #include "FontFactory.h" 12 | 13 | FontFactory::FontFactory() 14 | { 15 | } 16 | 17 | FontFactory::~FontFactory() 18 | { 19 | } 20 | 21 | void FontFactory::createDefaultFont() const 22 | { 23 | FontSP font = FontSP(new Font("CourierNew.tga", 512.0f, 512.0f, 16, 16, 32.0f, 18.0f, 10.0f, 16.0f)); 24 | FontManager::getInstance()->setFont("CourierNew", font); 25 | } 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FontFactory.h 3 | * 4 | * Created on: 21.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FONTFACTORY_H_ 9 | #define FONTFACTORY_H_ 10 | 11 | class FontFactory 12 | { 13 | public: 14 | FontFactory(); 15 | virtual ~FontFactory(); 16 | 17 | void createDefaultFont() const; 18 | 19 | }; 20 | 21 | #endif /* FONTFACTORY_H_ */ 22 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FontManager.cpp 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "FontManager.h" 9 | 10 | using namespace std; 11 | 12 | FontManager::FontManager() : 13 | Singleton() 14 | { 15 | } 16 | 17 | FontManager::~FontManager() 18 | { 19 | auto walker = allFonts.begin(); 20 | while (walker != allFonts.end()) 21 | { 22 | walker->second.reset(); 23 | walker++; 24 | } 25 | allFonts.clear(); 26 | } 27 | 28 | const FontSP& FontManager::getFont(const string& key) 29 | { 30 | return allFonts[key]; 31 | } 32 | 33 | void FontManager::setFont(const string& key, const FontSP& font) 34 | { 35 | allFonts[key] = font; 36 | } 37 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FontManager.h 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FONTMANAGER_H_ 9 | #define FONTMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Font.h" 17 | 18 | class FontManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | private: 24 | 25 | KeyValueMap allFonts; 26 | 27 | FontManager(); 28 | virtual ~FontManager(); 29 | 30 | public: 31 | 32 | const FontSP& getFont(const std::string& key); 33 | 34 | void setFont(const std::string& key, const FontSP& font); 35 | 36 | }; 37 | 38 | #endif /* FONTMANAGER_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontVAO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FontVAO.cpp 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer1/shader/Variables.h" 9 | #include "Font.h" 10 | 11 | #include "FontVAO.h" 12 | 13 | FontVAO::FontVAO(const ProgramSP& program, const Font& font) : 14 | VAO(program) 15 | { 16 | generateVAO(); 17 | 18 | glBindBuffer(GL_ARRAY_BUFFER, font.getVboVertices()); 19 | glVertexAttribPointer(program->getAttribLocation(a_vertex), 4, GL_FLOAT, GL_FALSE, 0, 0); 20 | glEnableVertexAttribArray(program->getAttribLocation(a_vertex)); 21 | 22 | glBindBuffer(GL_ARRAY_BUFFER, font.getVboTexCoords()); 23 | glVertexAttribPointer(program->getAttribLocation(a_texCoord), 2, GL_FLOAT, GL_FALSE, 0, 0); 24 | glEnableVertexAttribArray(program->getAttribLocation(a_texCoord)); 25 | 26 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, font.getVboIndices()); 27 | 28 | glEnableVertexAttribArray(0); 29 | 30 | unbind(); 31 | } 32 | 33 | FontVAO::~FontVAO() 34 | { 35 | deleteVAO(); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/font/FontVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FontVAO.h 3 | * 4 | * Created on: 16.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FONTVAO_H_ 9 | #define FONTVAO_H_ 10 | 11 | #include "../../layer1/shader/Program.h" 12 | #include "../../layer1/shader/VAO.h" 13 | 14 | class Font; 15 | 16 | class FontVAO : public VAO { 17 | public: 18 | FontVAO(const ProgramSP& program, const Font& font); 19 | virtual ~FontVAO(); 20 | }; 21 | 22 | typedef std::shared_ptr FontVAOSP; 23 | 24 | #endif /* FONTVAO_H_ */ 25 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/postprocess/PostProcessor2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PostProcessor.h 3 | * 4 | * Created on: 29.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef POSTPROCESSOR2D_H_ 9 | #define POSTPROCESSOR2D_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer1/texture/Texture2DMultisample.h" 14 | 15 | #include "PostProcessor.h" 16 | 17 | class PostProcessor2D : public PostProcessor 18 | { 19 | 20 | private: 21 | 22 | GLenum internalFormat; 23 | GLenum format; 24 | GLenum type; 25 | 26 | Texture2DMultisampleSP dummy; 27 | 28 | protected: 29 | 30 | virtual void setUniforms() const; 31 | 32 | public: 33 | 34 | PostProcessor2D(GLenum internalFormat, GLenum format, GLenum type, std::int32_t blurPixel = 2, float blurSigma = 0.5f, std::int32_t bloomPixel = 16, float bloomSigma = 5.0f, std::int32_t maxRadiusCoC = 16, float cocSigma = 5.0f, float aperture = 10.0f, float focal = 3.0f, float focusedObject = 6.0f); 35 | virtual ~PostProcessor2D(); 36 | 37 | }; 38 | 39 | typedef std::shared_ptr PostProcessor2DSP; 40 | 41 | #endif /* POSTPROCESSOR2D_H_ */ 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/postprocess/PostProcessor2DManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PostProcessorManager.h 3 | * 4 | * Created on: 29.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef POSTPROCESSOR2DMANAGER_H_ 9 | #define POSTPROCESSOR2DMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "PostProcessor2D.h" 17 | 18 | class PostProcessor2DManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | protected: 24 | 25 | KeyValueMap allPostProcessors; 26 | 27 | PostProcessor2DManager(); 28 | virtual ~PostProcessor2DManager(); 29 | 30 | public: 31 | 32 | bool containsPostProcessor(const std::string& key) const; 33 | 34 | const PostProcessor2DSP& getPostProcessor(const std::string& key) const; 35 | 36 | void addPostProcessor(const std::string& key, const PostProcessor2DSP& postProcessor); 37 | 38 | PostProcessor2DSP createPostProcessor(const std::string& key, GLenum internalFormat, GLenum format, GLenum type); 39 | 40 | }; 41 | 42 | #endif /* POSTPROCESSOR2DMANAGER_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/postprocess/PostProcessor2DMultisample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PostProcessor2DMultisample.h 3 | * 4 | * Created on: 05.02.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef POSTPROCESSOR2DMULTISAMPLE_H_ 9 | #define POSTPROCESSOR2DMULTISAMPLE_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer1/texture/Texture2D.h" 14 | 15 | #include "PostProcessor.h" 16 | 17 | class PostProcessor2DMultisample : public PostProcessor 18 | { 19 | private: 20 | 21 | std::int32_t samples; 22 | GLenum internalFormat; 23 | bool fixedsamplelocations; 24 | 25 | Texture2DSP dummy; 26 | 27 | protected: 28 | 29 | virtual void setUniforms() const; 30 | 31 | public: 32 | PostProcessor2DMultisample(std::int32_t samples, GLenum internalFormat, bool fixedsamplelocations, std::int32_t blurPixel = 2, float blurSigma = 0.5f, std::int32_t bloomPixel = 16, float bloomSigma = 5.0f, std::int32_t maxRadiusCoC = 16, float cocSigma = 5.0f, float aperture = 10.0f, float focal = 3.0f, float focusedObject = 6.0f); 33 | virtual ~PostProcessor2DMultisample(); 34 | }; 35 | 36 | typedef std::shared_ptr PostProcessor2DMultisampleSP; 37 | 38 | #endif /* POSTPROCESSOR2DMULTISAMPLE_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/postprocess/PostProcessorVAO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PostProcessorVAO.cpp 3 | * 4 | * Created on: 29.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer1/shader/Variables.h" 9 | #include "PostProcessor.h" 10 | 11 | #include "PostProcessorVAO.h" 12 | 13 | PostProcessorVAO::PostProcessorVAO(const ProgramSP& program, const PostProcessor& postProcessor) : 14 | VAO(program) 15 | { 16 | generateVAO(); 17 | 18 | glBindBuffer(GL_ARRAY_BUFFER, postProcessor.getVboVertices()); 19 | glVertexAttribPointer(program->getAttribLocation(a_vertex), 4, GL_FLOAT, GL_FALSE, 0, 0); 20 | glEnableVertexAttribArray(program->getAttribLocation(a_vertex)); 21 | 22 | glBindBuffer(GL_ARRAY_BUFFER, postProcessor.getVboTexCoords()); 23 | glVertexAttribPointer(program->getAttribLocation(a_texCoord), 2, GL_FLOAT, GL_FALSE, 0, 0); 24 | glEnableVertexAttribArray(program->getAttribLocation(a_texCoord)); 25 | 26 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, postProcessor.getVboIndices()); 27 | 28 | glEnableVertexAttribArray(0); 29 | 30 | unbind(); 31 | } 32 | 33 | PostProcessorVAO::~PostProcessorVAO() 34 | { 35 | deleteVAO(); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer4/postprocess/PostProcessorVAO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PostProcessorVAO.h 3 | * 4 | * Created on: 29.11.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef POSTPROCESSORVAO_H_ 9 | #define POSTPROCESSORVAO_H_ 10 | 11 | #include "../../layer1/shader/Program.h" 12 | #include "../../layer1/shader/VAO.h" 13 | 14 | class PostProcessor; 15 | 16 | class PostProcessorVAO : public VAO 17 | { 18 | public: 19 | PostProcessorVAO(const ProgramSP& program, const PostProcessor& postProcessor); 20 | virtual ~PostProcessorVAO(); 21 | }; 22 | 23 | typedef std::shared_ptr PostProcessorVAOSP; 24 | 25 | #endif /* POSTPROCESSORVAO_H_ */ 26 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/command/EntityCommandManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EntityCommandManager.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ENTITYCOMMANDMANAGER_H_ 9 | #define ENTITYCOMMANDMANAGER_H_ 10 | 11 | #include "../../layer0/concurrency/ThreadSafeCounter.h" 12 | #include "../../layer0/stereotype/Singleton.h" 13 | #include "../../layer4/entity/Entity.h" 14 | 15 | #include "UpdateCommand.h" 16 | 17 | class EntityCommandManager : public Singleton 18 | { 19 | 20 | friend class Singleton; 21 | 22 | private: 23 | 24 | UpdateCommandRecycleQueueSP updateCommandRecycleQueue; 25 | 26 | ThreadSafeCounterSP updateTaskCounter; 27 | 28 | EntityCommandManager(); 29 | ~EntityCommandManager(); 30 | 31 | public: 32 | 33 | void publishUpdateCommand(Entity* entity); 34 | 35 | void waitUpdateAllFinished(); 36 | 37 | }; 38 | 39 | #endif /* ENTITYCOMMANDMANAGER_H_ */ 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/command/UpdateCommand.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * UpdateCommand.cpp 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "UpdateCommand.h" 9 | 10 | using namespace std; 11 | 12 | UpdateCommand::UpdateCommand(const UpdateCommandRecycleQueueSP& updateCommandRecycleQueue, const ThreadSafeCounterSP& taskCounter) : Command(), updateCommandRecycleQueue(updateCommandRecycleQueue), taskCounter(taskCounter), entity(nullptr) 13 | { 14 | } 15 | 16 | UpdateCommand::~UpdateCommand() 17 | { 18 | } 19 | 20 | bool UpdateCommand::execute() 21 | { 22 | assert(this->taskCounter.get() != nullptr); 23 | assert(this->entity != nullptr); 24 | 25 | entity->update(); 26 | 27 | taskCounter->decrement(); 28 | 29 | return true; 30 | } 31 | 32 | void UpdateCommand::recycle() 33 | { 34 | entity = nullptr; 35 | updateCommandRecycleQueue->add(this); 36 | } 37 | 38 | void UpdateCommand::init(Entity* entity) 39 | { 40 | assert(this->taskCounter.get() != nullptr); 41 | assert(this->entity == nullptr); 42 | 43 | taskCounter->increment(); 44 | 45 | this->entity = entity; 46 | } 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/command/UpdateCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UpdateCommand.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef UPDATECOMMAND_H_ 9 | #define UPDATECOMMAND_H_ 10 | 11 | #include "../../layer0/concurrency/ThreadSafeCounter.h" 12 | #include "../../layer1/command/Command.h" 13 | #include "../../layer4/entity/Entity.h" 14 | 15 | class UpdateCommand: public Command 16 | { 17 | 18 | friend class EntityCommandManager; 19 | 20 | private: 21 | 22 | std::shared_ptr > updateCommandRecycleQueue; 23 | 24 | ThreadSafeCounterSP taskCounter; 25 | 26 | Entity* entity; 27 | 28 | UpdateCommand(const std::shared_ptr >& updateCommandRecycleQueue, const ThreadSafeCounterSP& taskCounter); 29 | 30 | virtual ~UpdateCommand(); 31 | 32 | public: 33 | 34 | virtual bool execute(); 35 | 36 | virtual void recycle(); 37 | 38 | void init(Entity* entity); 39 | 40 | }; 41 | 42 | typedef std::shared_ptr > UpdateCommandRecycleQueueSP; 43 | 44 | #endif /* UPDATECOMMAND_H_ */ 45 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/debug/FpsPrinter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FpsPrinter.cpp 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "../../layer4/font/Font.h" 9 | #include "../../layer4/font/FontManager.h" 10 | 11 | #include "FpsPrinter.h" 12 | 13 | FpsPrinter FpsPrinter::printer = FpsPrinter(); 14 | 15 | FpsPrinter::FpsPrinter() : 16 | fontColor(Color(1.0f, 0.0f, 0.0f, 1.0f)) 17 | { 18 | } 19 | 20 | FpsPrinter::~FpsPrinter() 21 | { 22 | } 23 | 24 | void FpsPrinter::print(float deltaTime) 25 | { 26 | frameCounter.increaseElapsedTime(deltaTime); 27 | FontSP currentFont = FontManager::getInstance()->getFont("CourierNew"); 28 | currentFont->print(10.0f, 10.0f, fontColor, 29 | frameCounter.calculateFramesPerSecondAsString()); 30 | frameCounter.increaseNumberFrames(); 31 | } 32 | 33 | const Color& FpsPrinter::getFontColor() const 34 | { 35 | return fontColor; 36 | } 37 | 38 | void FpsPrinter::setFontColor(const Color& fontColor) 39 | { 40 | this->fontColor = fontColor; 41 | } 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/debug/FpsPrinter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FpsPrinter.h 3 | * 4 | * Created on: 28.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FPSPRINTER_H_ 9 | #define FPSPRINTER_H_ 10 | 11 | #include "../../layer0/color/Color.h" 12 | #include "../../layer0/statistic/FrameCounter.h" 13 | 14 | class FpsPrinter 15 | { 16 | 17 | private: 18 | 19 | FrameCounter frameCounter; 20 | 21 | Color fontColor; 22 | 23 | FpsPrinter(); 24 | virtual ~FpsPrinter(); 25 | 26 | public: 27 | 28 | static FpsPrinter printer; 29 | 30 | void print(float deltaTime); 31 | 32 | const Color& getFontColor() const; 33 | void setFontColor(const Color& fontColor); 34 | 35 | }; 36 | 37 | #endif /* FPSPRINTER_H_ */ 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/environment/DynamicEnvironment.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DynamicEnvironment.h 3 | * 4 | * Created on: 27.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DYNAMICENVIRONMENT_H_ 9 | #define DYNAMICENVIRONMENT_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer2/framebuffer/FrameBufferCubeMap.h" 14 | #include "../../layer3/camera/PerspectiveCamera.h" 15 | #include "../../layer3/camera/Viewport.h" 16 | 17 | class DynamicEnvironment 18 | { 19 | 20 | private: 21 | 22 | FrameBufferCubeMapSP frameBufferCubeMap; 23 | 24 | PerspectiveCameraSP camera[6]; 25 | ViewportSP viewport; 26 | 27 | Point4 lastPosition; 28 | 29 | void init(const Point4& position); 30 | 31 | public: 32 | DynamicEnvironment(const Point4& position, const FrameBufferCubeMapSP& frameBufferCubeMap); 33 | virtual ~DynamicEnvironment(); 34 | 35 | const FrameBufferCubeMapSP& getFrameBufferCubeMap() const; 36 | 37 | const PerspectiveCameraSP& getCamera(std::int32_t index) const; 38 | 39 | bool use(const Point4& position); 40 | 41 | bool unuse(); 42 | 43 | }; 44 | 45 | typedef std::shared_ptr DynamicEnvironmentSP; 46 | 47 | #endif /* DYNAMICENVIRONMENT_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/environment/DynamicEnvironmentManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DynamicEnvironmentManager.h 3 | * 4 | * Created on: 21.04.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef DYNAMICENVIRONMENTMANAGER_H_ 9 | #define DYNAMICENVIRONMENTMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | #include "../../layer2/framebuffer/FrameBufferCubeMap.h" 16 | #include "../../layer3/camera/PerspectiveCamera.h" 17 | #include "../../layer4/entity/Entity.h" 18 | 19 | #include "DynamicEnvironment.h" 20 | 21 | class DynamicEnvironmentManager : public Singleton 22 | { 23 | 24 | friend class Singleton; 25 | 26 | protected: 27 | 28 | KeyValueMap allDynamicEnvironments; 29 | 30 | DynamicEnvironmentManager(); 31 | virtual ~DynamicEnvironmentManager(); 32 | 33 | public: 34 | 35 | FrameBufferCubeMapSP createCubeMap(const EntitySP& entity, std::int32_t length); 36 | 37 | const KeyValueMap& getKeyValueMap() const; 38 | 39 | }; 40 | 41 | #endif /* DYNAMICENVIRONMENTMANAGER_H_ */ 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer5/node/NodeOwner.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NodeOwner.h 3 | * 4 | * Created on: 12.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef NODEOWNER_H_ 9 | #define NODEOWNER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/math/Matrix3x3.h" 14 | #include "../../layer0/math/Matrix4x4.h" 15 | #include "../../layer3/animation/AnimationStack.h" 16 | 17 | class InstanceNode; 18 | class Node; 19 | 20 | class NodeOwner { 21 | public: 22 | NodeOwner() 23 | { 24 | } 25 | 26 | virtual ~NodeOwner() 27 | { 28 | } 29 | 30 | virtual void renderNode(const Node& node, const InstanceNode& instanceNode, float time, std::int32_t animStackIndex, std::int32_t animLayerIndex) const = 0; 31 | 32 | virtual void addLightNode(const InstanceNodeSP& lightNode) = 0; 33 | 34 | virtual void addCameraNode(const InstanceNodeSP& cameraNode) = 0; 35 | 36 | }; 37 | 38 | #endif /* NODEOWNER_H_ */ 39 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer6/model/ModelManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ModelManager.cpp 3 | * 4 | * Created on: 28.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "ModelManager.h" 9 | 10 | using namespace std; 11 | 12 | ModelManager::ModelManager() : 13 | Singleton(), allModels() 14 | { 15 | } 16 | 17 | ModelManager::~ModelManager() 18 | { 19 | map::iterator walker = allModels.begin(); 20 | while (walker != allModels.end()) 21 | { 22 | walker->second.reset(); 23 | walker++; 24 | } 25 | allModels.clear(); 26 | } 27 | 28 | bool ModelManager::containsModelByKey(const string& key) const 29 | { 30 | return allModels.contains(key); 31 | } 32 | 33 | const ModelSP& ModelManager::getModelByKey(const string& key) const 34 | { 35 | return allModels.at(key); 36 | } 37 | 38 | void ModelManager::setModel(const string& key, const ModelSP& model) 39 | { 40 | allModels[key] = model; 41 | } 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer6/model/ModelManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ModelManager.h 3 | * 4 | * Created on: 28.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef MODELMANAGER_H_ 9 | #define MODELMANAGER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/stereotype/KeyValueMap.h" 14 | #include "../../layer0/stereotype/Singleton.h" 15 | 16 | #include "Model.h" 17 | 18 | class ModelManager : public Singleton 19 | { 20 | 21 | friend class Singleton; 22 | 23 | protected: 24 | 25 | KeyValueMap allModels; 26 | 27 | ModelManager(); 28 | virtual ~ModelManager(); 29 | 30 | public: 31 | 32 | bool containsModelByKey(const std::string& key) const; 33 | 34 | const ModelSP& getModelByKey(const std::string& key) const; 35 | 36 | void setModel(const std::string& key, const ModelSP& model); 37 | 38 | }; 39 | 40 | #endif /* MODELMANAGER_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer6/octree/OctreeEntity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctreeEntity.h 3 | * 4 | * Created on: 23.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef OCTREEENTITY_H_ 9 | #define OCTREEENTITY_H_ 10 | 11 | #include "../../layer4/entity/Entity.h" 12 | 13 | class Octant; 14 | 15 | class OctreeEntity : public Entity 16 | { 17 | 18 | friend class Octree; 19 | friend class Octant; 20 | 21 | private: 22 | 23 | Octant* previousVisitingOctant; 24 | 25 | Octant* visitingOctant; 26 | 27 | Octant* getPreviousVisitingOctant() const; 28 | void setPreviousVisitingOctant(Octant *previousVisitingOctant); 29 | 30 | Octant* getVisitingOctant() const; 31 | void setVisitingOctant(Octant *visitingOctant); 32 | 33 | protected: 34 | 35 | OctreeEntity(); 36 | virtual ~OctreeEntity(); 37 | 38 | public: 39 | 40 | bool insideVisitingOctant() const; 41 | 42 | }; 43 | 44 | typedef std::shared_ptr OctreeEntitySP; 45 | 46 | #endif /* OCTREEENTITY_H_ */ 47 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer6/octree/OctreeFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OctreeFactory.cpp 3 | * 4 | * Created on: 22.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #include "../../UsedLibs.h" 9 | 10 | #include "OctreeFactory.h" 11 | 12 | using namespace std; 13 | 14 | OctreeFactory::OctreeFactory() 15 | { 16 | } 17 | 18 | OctreeFactory::~OctreeFactory() 19 | { 20 | } 21 | 22 | OctreeSP OctreeFactory::createOctree(uint32_t maxLevels, uint32_t maxElements, const Point4& center, float width, float height, float depth) const 23 | { 24 | return OctreeSP(new Octree(maxLevels, maxElements, center, width / 2.0f, height / 2.0f, depth / 2.0f), std::default_delete()); 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer6/octree/OctreeFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OctreeFactory.h 3 | * 4 | * Created on: 22.04.2011 5 | * Author: Norbert Nopper 6 | */ 7 | 8 | #ifndef OCTREEFACTORY_H_ 9 | #define OCTREEFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer0/math/Point4.h" 14 | #include "Octree.h" 15 | 16 | class OctreeFactory 17 | { 18 | 19 | public: 20 | 21 | OctreeFactory(); 22 | virtual ~OctreeFactory(); 23 | 24 | OctreeSP createOctree(std::uint32_t maxLevels, std::uint32_t maxElements, const Point4& center, float width, float height, float depth) const; 25 | 26 | }; 27 | 28 | #endif /* OCTREEFACTORY_H_ */ 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer8/path/LinePath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LinePath.h 3 | * 4 | * Created on: 12.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LINEPATH_H_ 9 | #define LINEPATH_H_ 10 | 11 | #include "../../layer0/math/Point4.h" 12 | 13 | #include "Path.h" 14 | 15 | class LinePath : public Path 16 | { 17 | 18 | protected: 19 | 20 | Point4 startPosition; 21 | 22 | Point4 endPosition; 23 | 24 | Vector3 direction; 25 | 26 | bool goToEnd; 27 | 28 | protected: 29 | 30 | virtual void start(); 31 | 32 | /** 33 | * @return true, if end of path reached. If looping, always false. 34 | */ 35 | virtual bool update(float deltaTime, const GeneralEntitySP& entity, bool updateRotation = true); 36 | 37 | public: 38 | 39 | LinePath(const Quaternion& baseRotation, const Point4& startPosition, const Point4& endPosition); 40 | virtual ~LinePath(); 41 | 42 | }; 43 | 44 | #endif /* LINEPATH_H_ */ 45 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer8/path/OrientedCirclePath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OrientedCirclePath.h 3 | * 4 | * Created on: 13.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ORIENTEDCIRCLEPATH_H_ 9 | #define ORIENTEDCIRCLEPATH_H_ 10 | 11 | #include "CirclePath.h" 12 | 13 | class OrientedCirclePath : public CirclePath 14 | { 15 | 16 | protected: 17 | 18 | virtual void start(); 19 | 20 | /** 21 | * @return true, if end of path reached. If looping, always false. 22 | */ 23 | virtual bool update(float deltaTime, const GeneralEntitySP& entity, bool updateRotation = true); 24 | 25 | public: 26 | 27 | OrientedCirclePath(const Quaternion& baseRotation, const Point4& startPosition, const Point4& orbitPosition, bool clockWise); 28 | OrientedCirclePath(const Quaternion& baseRotation, const Point4& startPosition, const Point4& orbitPosition, bool clockWise, const Vector3& rotationAxis); 29 | virtual ~OrientedCirclePath(); 30 | 31 | }; 32 | 33 | #endif /* ORIENTEDCIRCLEPATH_H_ */ 34 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer8/path/OrientedLinePath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OrientedLinePath.cpp 3 | * 4 | * Created on: 13.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #include "OrientedLinePath.h" 9 | 10 | OrientedLinePath::OrientedLinePath(const Quaternion& baseRotation, const Point4& startPosition, const Point4& endPosition) : 11 | LinePath(baseRotation, startPosition, endPosition) 12 | { 13 | } 14 | 15 | OrientedLinePath::~OrientedLinePath() 16 | { 17 | } 18 | 19 | void OrientedLinePath::start() 20 | { 21 | LinePath::start(); 22 | } 23 | 24 | bool OrientedLinePath::update(float deltaTime, const GeneralEntitySP& entity, bool updateRotation) 25 | { 26 | bool result = LinePath::update(deltaTime, entity, false); 27 | 28 | float rotY = -glusMathRadToDegf(asinf(direction.getX())); 29 | float rotX = glusMathRadToDegf(asinf(direction.getY())); 30 | 31 | Quaternion rotation; 32 | rotation.rotateRzRyRxf(0.0f, rotY, rotX); 33 | setRotation(rotation * baseRotation); 34 | 35 | return result; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer8/path/OrientedLinePath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OrientedLinePath.h 3 | * 4 | * Created on: 13.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef ORIENTEDLINEPATH_H_ 9 | #define ORIENTEDLINEPATH_H_ 10 | 11 | #include "LinePath.h" 12 | 13 | class OrientedLinePath : public LinePath 14 | { 15 | 16 | protected: 17 | 18 | virtual void start(); 19 | 20 | /** 21 | * @return true, if end of path reached. If looping, always false. 22 | */ 23 | virtual bool update(float deltaTime, const GeneralEntitySP& entity, bool updateRotation = true); 24 | 25 | public: 26 | 27 | OrientedLinePath(const Quaternion& baseRotation, const Point4& startPosition, const Point4& endPosition); 28 | virtual ~OrientedLinePath(); 29 | 30 | }; 31 | 32 | #endif /* ORIENTEDLINEPATH_H_ */ 33 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer8/path/PathEntityManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PathEntityManager.h 3 | * 4 | * Created on: 11.03.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef PATHENTITYMANAGER_H_ 9 | #define PATHENTITYMANAGER_H_ 10 | 11 | #include "../../layer0/stereotype/KeyValueMap.h" 12 | #include "../../layer0/stereotype/Singleton.h" 13 | #include "../../layer7/entity/GeneralEntity.h" 14 | #include "Path.h" 15 | 16 | class PathEntityManager : public Singleton 17 | { 18 | 19 | friend class Singleton; 20 | 21 | private: 22 | 23 | KeyValueMap allPaths; 24 | 25 | protected: 26 | 27 | PathEntityManager(); 28 | virtual ~PathEntityManager(); 29 | 30 | public: 31 | 32 | void addEntity(const GeneralEntitySP& entity, const PathSP& path); 33 | 34 | PathSP findPath(const GeneralEntitySP& entity) const; 35 | 36 | bool updateEntity(const GeneralEntitySP& entity, float deltaTime); 37 | 38 | void updateEntities(float deltaTime); 39 | 40 | }; 41 | 42 | #endif /* PATHENTITYMANAGER_H_ */ 43 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/camerafactory/CameraEntityFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CameraEntityFactory.h 3 | * 4 | * Created on: 19.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef CAMERAENTITYFACTORY_H_ 9 | #define CAMERAENTITYFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer3/camera/Camera.h" 14 | #include "../../layer8/modelentity/ModelEntity.h" 15 | 16 | class CameraEntityFactory 17 | { 18 | public: 19 | CameraEntityFactory(); 20 | virtual ~CameraEntityFactory(); 21 | 22 | ModelEntitySP createCameraEntity(const std::string& name, const CameraSP& camera); 23 | 24 | ModelEntitySP createCameraEntity(const std::string& name, const CameraSP& camera, const std::vector& allAnimStacks); 25 | 26 | }; 27 | 28 | #endif /* CAMERAENTITYFACTORY_H_ */ 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/fbxfactory/FbxSubMesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FbxSubMesh.cpp 3 | * 4 | * Created on: 05.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #include "FbxSubMesh.h" 9 | 10 | using namespace std; 11 | 12 | FbxSubMesh::FbxSubMesh() : indicesOffset(0), storedIndices(0), triangleCount(0) 13 | { 14 | } 15 | 16 | FbxSubMesh::~FbxSubMesh() 17 | { 18 | } 19 | 20 | void FbxSubMesh::setIndicesOffset(uint32_t indicesOffset) 21 | { 22 | this->indicesOffset = indicesOffset; 23 | } 24 | 25 | uint32_t FbxSubMesh::getAndIncreaseStoredIndices() 26 | { 27 | uint32_t result = storedIndices; 28 | 29 | storedIndices += 3; 30 | 31 | return result; 32 | } 33 | 34 | void FbxSubMesh::setTriangleCount(uint32_t triangleCount) 35 | { 36 | this->triangleCount = triangleCount; 37 | } 38 | 39 | void FbxSubMesh::increaseTriangleCount() 40 | { 41 | triangleCount++; 42 | } 43 | 44 | uint32_t FbxSubMesh::getIndicesOffset() const 45 | { 46 | return indicesOffset; 47 | } 48 | 49 | uint32_t FbxSubMesh::getTriangleCount() const 50 | { 51 | return triangleCount; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/fbxfactory/FbxSubMesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FbxSubMesh.h 3 | * 4 | * Created on: 05.09.2012 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef FBXSUBMESH_H_ 9 | #define FBXSUBMESH_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class FbxSubMesh 14 | { 15 | 16 | private: 17 | 18 | std::uint32_t indicesOffset; 19 | std::uint32_t storedIndices; 20 | std::uint32_t triangleCount; 21 | 22 | public: 23 | FbxSubMesh(); 24 | virtual ~FbxSubMesh(); 25 | 26 | void setIndicesOffset(std::uint32_t indicesOffset); 27 | std::uint32_t getAndIncreaseStoredIndices(); 28 | 29 | void setTriangleCount(std::uint32_t triangleCount); 30 | void increaseTriangleCount(); 31 | 32 | std::uint32_t getIndicesOffset() const; 33 | 34 | std::uint32_t getTriangleCount() const; 35 | 36 | }; 37 | 38 | typedef std::shared_ptr FbxSubMeshSP; 39 | 40 | #endif /* FBXSUBMESH_H_ */ 41 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfAccessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfAccessor.h 3 | * 4 | * Created on: 04.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFACCESSOR_H_ 9 | #define GLTFACCESSOR_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "GlTfBufferView.h" 14 | 15 | class GlTfAccessor 16 | { 17 | 18 | private: 19 | 20 | GlTfBufferViewSP bufferView; 21 | std::int32_t byteOffset; 22 | std::int32_t byteStride; 23 | GLenum componentType; 24 | std::int32_t count; 25 | std::string type; 26 | 27 | public: 28 | 29 | GlTfAccessor(GlTfBufferViewSP bufferView, std::int32_t byteOffset, std::int32_t byteStride, GLenum componentType, std::int32_t count, std::string type); 30 | virtual ~GlTfAccessor(); 31 | 32 | const GlTfBufferViewSP& getBufferView() const; 33 | std::int32_t getByteOffset() const; 34 | std::int32_t getByteStride() const; 35 | GLenum getComponentType() const; 36 | std::int32_t getCount() const; 37 | const std::string& getType() const; 38 | 39 | std::int32_t getNumberComponents() const; 40 | 41 | const std::uint8_t* getData() const; 42 | 43 | }; 44 | 45 | typedef std::shared_ptr GlTfAccessorSP; 46 | 47 | #endif /* GLTFACCESSOR_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfAnimation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfAnimation.cpp 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfAnimation.h" 9 | 10 | using namespace std; 11 | 12 | GlTfAnimation::GlTfAnimation() : 13 | startTime(0.0f), stopTime(0.0f), allChannels() 14 | { 15 | } 16 | 17 | GlTfAnimation::~GlTfAnimation() 18 | { 19 | } 20 | 21 | float GlTfAnimation::getStartTime() const 22 | { 23 | return startTime; 24 | } 25 | 26 | void GlTfAnimation::setStartTime(float startTime) 27 | { 28 | this->startTime = startTime; 29 | } 30 | 31 | float GlTfAnimation::getStopTime() const 32 | { 33 | return stopTime; 34 | } 35 | 36 | void GlTfAnimation::setStopTime(float stopTime) 37 | { 38 | this->stopTime = stopTime; 39 | } 40 | 41 | void GlTfAnimation::addChannel(const GlTfChannelSP& channel) 42 | { 43 | allChannels.push_back(channel); 44 | } 45 | 46 | const vector& GlTfAnimation::getAllChannels() const 47 | { 48 | return allChannels; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfAnimation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfAnimation.h 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFANIMATION_H_ 9 | #define GLTFANIMATION_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "GlTfChannel.h" 14 | 15 | class GlTfAnimation 16 | { 17 | 18 | private: 19 | 20 | float startTime; 21 | float stopTime; 22 | 23 | std::vector allChannels; 24 | 25 | public: 26 | 27 | GlTfAnimation(); 28 | virtual ~GlTfAnimation(); 29 | 30 | float getStartTime() const; 31 | void setStartTime(float startTime); 32 | 33 | float getStopTime() const; 34 | void setStopTime(float stopTime); 35 | 36 | void addChannel(const GlTfChannelSP& channel); 37 | 38 | const std::vector& getAllChannels() const; 39 | }; 40 | 41 | typedef std::shared_ptr GlTfAnimationSP; 42 | 43 | #endif /* GLTFANIMATION_H_ */ 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfBin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfBin.cpp 3 | * 4 | * Created on: 21.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfBin.h" 9 | 10 | using namespace std; 11 | 12 | GlTfBin::GlTfBin() : data(), counter(0) 13 | { 14 | } 15 | 16 | GlTfBin::~GlTfBin() 17 | { 18 | } 19 | 20 | void GlTfBin::addData(const std::uint8_t* data, const size_t length) 21 | { 22 | for (size_t i = 0; i < length; i++) 23 | { 24 | this->data.push_back(data[i]); 25 | } 26 | 27 | counter++; 28 | } 29 | 30 | size_t GlTfBin::getLength() const 31 | { 32 | return data.size(); 33 | } 34 | 35 | size_t GlTfBin::getCounter() const 36 | { 37 | return counter; 38 | } 39 | 40 | const uint8_t* GlTfBin::getData() const 41 | { 42 | return &data[0]; 43 | } 44 | 45 | void GlTfBin::reset() 46 | { 47 | data.clear(); 48 | 49 | counter = 0; 50 | } 51 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfBin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfBin.h 3 | * 4 | * Created on: 21.06.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFBIN_H_ 9 | #define GLTFBIN_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class GlTfBin 14 | { 15 | 16 | private: 17 | 18 | std::vector data; 19 | 20 | size_t counter; 21 | 22 | public: 23 | 24 | GlTfBin(); 25 | virtual ~GlTfBin(); 26 | 27 | void addData(const std::uint8_t* data, const size_t length); 28 | 29 | size_t getLength() const; 30 | 31 | size_t getCounter() const; 32 | 33 | const std::uint8_t* getData() const; 34 | 35 | void reset(); 36 | 37 | }; 38 | 39 | #endif /* GLTFBIN_H_ */ 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfBufferView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfBufferView.cpp 3 | * 4 | * Created on: 04.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfBufferView.h" 9 | 10 | using namespace std; 11 | 12 | GlTfBufferView::GlTfBufferView(const uint8_t* buffer, int32_t byteOffset, int32_t byteLength, GLenum target) : 13 | buffer(buffer), byteOffset(byteOffset), byteLength(byteLength), target(target) 14 | { 15 | } 16 | 17 | GlTfBufferView::~GlTfBufferView() 18 | { 19 | } 20 | 21 | const uint8_t* GlTfBufferView::getData() const 22 | { 23 | return &buffer[byteOffset]; 24 | } 25 | 26 | const uint8_t* GlTfBufferView::getBuffer() const 27 | { 28 | return buffer; 29 | } 30 | 31 | int32_t GlTfBufferView::getByteLength() const 32 | { 33 | return byteLength; 34 | } 35 | 36 | int32_t GlTfBufferView::getByteOffset() const 37 | { 38 | return byteOffset; 39 | } 40 | 41 | GLenum GlTfBufferView::getTarget() const 42 | { 43 | return target; 44 | } 45 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfBufferView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfBufferView.h 3 | * 4 | * Created on: 04.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFBUFFERVIEW_H_ 9 | #define GLTFBUFFERVIEW_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class GlTfBufferView 14 | { 15 | 16 | private: 17 | 18 | const std::uint8_t* buffer; 19 | 20 | std::int32_t byteOffset; 21 | 22 | std::int32_t byteLength; 23 | 24 | GLenum target; 25 | 26 | public: 27 | 28 | GlTfBufferView(const std::uint8_t* buffer, std::int32_t byteOffset, std::int32_t byteLength, GLenum target); 29 | 30 | virtual ~GlTfBufferView(); 31 | 32 | const std::uint8_t* getData() const; 33 | 34 | const std::uint8_t* getBuffer() const; 35 | std::int32_t getByteLength() const; 36 | std::int32_t getByteOffset() const; 37 | GLenum getTarget() const; 38 | 39 | }; 40 | 41 | typedef std::shared_ptr GlTfBufferViewSP; 42 | 43 | #endif /* GLTFBUFFERVIEW_H_ */ 44 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfInstanceSkin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfInstanceSkin.cpp 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfInstanceSkin.h" 9 | 10 | using namespace std; 11 | 12 | GlTfInstanceSkin::GlTfInstanceSkin() : 13 | allSkeletonNames(), skin(), allSources() 14 | { 15 | } 16 | 17 | GlTfInstanceSkin::~GlTfInstanceSkin() 18 | { 19 | } 20 | 21 | void GlTfInstanceSkin::addSkeletonName(const string& skeletonName) 22 | { 23 | allSkeletonNames.push_back(skeletonName); 24 | } 25 | 26 | const vector& GlTfInstanceSkin::getAllSkeletonNames() const 27 | { 28 | return allSkeletonNames; 29 | } 30 | 31 | const GlTfSkinSP& GlTfInstanceSkin::getSkin() const 32 | { 33 | return skin; 34 | } 35 | 36 | void GlTfInstanceSkin::setSkin(const GlTfSkinSP& skin) 37 | { 38 | this->skin = skin; 39 | } 40 | 41 | 42 | void GlTfInstanceSkin::addSource(const GlTfMeshSP& source) 43 | { 44 | allSources.push_back(source); 45 | } 46 | 47 | const vector& GlTfInstanceSkin::getAllSources() const 48 | { 49 | return allSources; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfInstanceSkin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfInstanceSkin.h 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFINSTANCESKIN_H_ 9 | #define GLTFINSTANCESKIN_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "GlTfMesh.h" 14 | #include "GlTfSkin.h" 15 | 16 | class GlTfInstanceSkin 17 | { 18 | 19 | private: 20 | 21 | std::vector allSkeletonNames; 22 | 23 | GlTfSkinSP skin; 24 | 25 | std::vector allSources; 26 | 27 | public: 28 | 29 | GlTfInstanceSkin(); 30 | virtual ~GlTfInstanceSkin(); 31 | 32 | void addSkeletonName(const std::string& skeletonName); 33 | 34 | const std::vector& getAllSkeletonNames() const; 35 | 36 | const GlTfSkinSP& getSkin() const; 37 | void setSkin(const GlTfSkinSP& skin); 38 | 39 | void addSource(const GlTfMeshSP& source); 40 | 41 | const std::vector& getAllSources() const; 42 | 43 | }; 44 | 45 | typedef std::shared_ptr GlTfInstanceSkinSP; 46 | 47 | #endif /* GLTFINSTANCESKIN_H_ */ 48 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfMesh.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfMesh.cpp 3 | * 4 | * Created on: 07.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfMesh.h" 9 | 10 | using namespace std; 11 | 12 | GlTfMesh::GlTfMesh(const string& name) : 13 | name(name), allPrimitives() 14 | { 15 | } 16 | 17 | GlTfMesh::~GlTfMesh() 18 | { 19 | } 20 | 21 | const string& GlTfMesh::getName() const 22 | { 23 | return name; 24 | } 25 | 26 | void GlTfMesh::addPrimitive(const GlTfPrimitiveSP& primitive) 27 | { 28 | allPrimitives.push_back(primitive); 29 | } 30 | 31 | const std::vector& GlTfMesh::getAllPrimitives() const 32 | { 33 | return allPrimitives; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfMesh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfMesh.h 3 | * 4 | * Created on: 07.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFMESH_H_ 9 | #define GLTFMESH_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "GlTfPrimitive.h" 14 | 15 | class GlTfMesh 16 | { 17 | 18 | private: 19 | 20 | std::string name; 21 | 22 | std::vector allPrimitives; 23 | 24 | public: 25 | 26 | GlTfMesh(const std::string& name); 27 | virtual ~GlTfMesh(); 28 | 29 | const std::string& getName() const; 30 | 31 | void addPrimitive(const GlTfPrimitiveSP& primitive); 32 | 33 | const std::vector& getAllPrimitives() const; 34 | 35 | }; 36 | 37 | typedef std::shared_ptr GlTfMeshSP; 38 | 39 | #endif /* GLTFMESH_H_ */ 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfSampler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfSampler.cpp 3 | * 4 | * Created on: 04.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfSampler.h" 9 | 10 | GlTfSampler::GlTfSampler(GLenum magFilter, GLenum minFilter, GLenum wrapS, GLenum wrapT) : 11 | magFilter(magFilter), minFilter(minFilter), wrapS(wrapS), wrapT(wrapT) 12 | { 13 | } 14 | 15 | GlTfSampler::~GlTfSampler() 16 | { 17 | } 18 | 19 | GLenum GlTfSampler::getMagFilter() const 20 | { 21 | return magFilter; 22 | } 23 | 24 | GLenum GlTfSampler::getMinFilter() const 25 | { 26 | return minFilter; 27 | } 28 | 29 | GLenum GlTfSampler::getWrapS() const 30 | { 31 | return wrapS; 32 | } 33 | 34 | GLenum GlTfSampler::getWrapT() const 35 | { 36 | return wrapT; 37 | } 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfSampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfSampler.h 3 | * 4 | * Created on: 04.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFSAMPLER_H_ 9 | #define GLTFSAMPLER_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | class GlTfSampler 14 | { 15 | 16 | private: 17 | 18 | GLenum magFilter; 19 | GLenum minFilter; 20 | GLenum wrapS; 21 | GLenum wrapT; 22 | 23 | public: 24 | 25 | GlTfSampler(GLenum magFilter, GLenum minFilter, GLenum wrapS, GLenum wrapT); 26 | virtual ~GlTfSampler(); 27 | 28 | GLenum getMagFilter() const; 29 | GLenum getMinFilter() const; 30 | GLenum getWrapS() const; 31 | GLenum getWrapT() const; 32 | 33 | }; 34 | 35 | typedef std::shared_ptr GlTfSamplerSP; 36 | 37 | #endif /* GLTFSAMPLER_H_ */ 38 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfSkin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfSkin.cpp 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #include "GlTfSkin.h" 9 | 10 | using namespace std; 11 | 12 | GlTfSkin::GlTfSkin() : 13 | inverseBindMatrices(), allJointNames() 14 | { 15 | } 16 | 17 | GlTfSkin::~GlTfSkin() 18 | { 19 | } 20 | 21 | const GlTfAccessorSP& GlTfSkin::getInverseBindMatrices() const 22 | { 23 | return inverseBindMatrices; 24 | } 25 | 26 | void GlTfSkin::setInverseBindMatrices(const GlTfAccessorSP& inverseBindMatrices) 27 | { 28 | this->inverseBindMatrices = inverseBindMatrices; 29 | } 30 | 31 | void GlTfSkin::addJointName(const string& jointName) 32 | { 33 | allJointNames.push_back(jointName); 34 | } 35 | 36 | const vector& GlTfSkin::getAllJointNames() const 37 | { 38 | return allJointNames; 39 | } 40 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/gltffactory/GlTfSkin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GlTfSkin.h 3 | * 4 | * Created on: 08.07.2014 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GLTFSKIN_H_ 9 | #define GLTFSKIN_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "GlTfAccessor.h" 14 | 15 | class GlTfSkin 16 | { 17 | 18 | private: 19 | 20 | GlTfAccessorSP inverseBindMatrices; 21 | 22 | std::vector allJointNames; 23 | 24 | public: 25 | 26 | GlTfSkin(); 27 | virtual ~GlTfSkin(); 28 | 29 | const GlTfAccessorSP& getInverseBindMatrices() const; 30 | void setInverseBindMatrices(const GlTfAccessorSP& inverseBindMatrices); 31 | 32 | 33 | void addJointName(const std::string& jointName); 34 | 35 | const std::vector& getAllJointNames() const; 36 | 37 | }; 38 | 39 | typedef std::shared_ptr GlTfSkinSP; 40 | 41 | #endif /* GLTFSKIN_H_ */ 42 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/groundfactory/GroundEntityFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * GroundEntityFactory.h 3 | * 4 | * Created on: 18.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef GROUNDENTITYFACTORY_H_ 9 | #define GROUNDENTITYFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer2/material/SurfaceMaterial.h" 14 | #include "../../layer8/groundentity/GroundEntity.h" 15 | 16 | class GroundEntityFactory 17 | { 18 | 19 | public: 20 | 21 | GroundEntityFactory(); 22 | virtual ~GroundEntityFactory(); 23 | 24 | GroundEntitySP createGroundEntity(const std::string& name, float scaleX, float scaleY, float scaleZ, const SurfaceMaterialSP& surfaceMaterial) const; 25 | 26 | }; 27 | 28 | #endif /* GROUNDENTITYFACTORY_H_ */ 29 | -------------------------------------------------------------------------------- /GraphicsEngine/src/layer9/lightfactory/LightEntityFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LightEntityFactory.h 3 | * 4 | * Created on: 19.05.2013 5 | * Author: nopper 6 | */ 7 | 8 | #ifndef LIGHTENTITYFACTORY_H_ 9 | #define LIGHTENTITYFACTORY_H_ 10 | 11 | #include "../../UsedLibs.h" 12 | 13 | #include "../../layer3/light/Light.h" 14 | #include "../../layer8/modelentity/ModelEntity.h" 15 | 16 | class LightEntityFactory 17 | { 18 | 19 | public: 20 | 21 | LightEntityFactory(); 22 | virtual ~LightEntityFactory(); 23 | 24 | ModelEntitySP createLightEntity(const std::string& name, const LightSP& light); 25 | 26 | ModelEntitySP createLightEntity(const std::string& name, const LightSP& light, const std::vector& allAnimStacks); 27 | 28 | }; 29 | 30 | #endif /* LIGHTENTITYFACTORY_H_ */ 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GraphicsEngine 2 | ============== 3 | 4 | OpenGL 4 Graphics Engine 5 | 6 | Please read [GLUS/README.txt](https://github.com/McNopper/GraphicsEngine/blob/master/GLUS/README.txt) 7 | 8 | Please read [GraphicsEngine/README.txt](https://github.com/McNopper/GraphicsEngine/blob/master/GraphicsEngine/README.txt) 9 | 10 | Please read [GE_Binaries/README.txt](https://github.com/McNopper/GraphicsEngine/blob/master/GE_Binaries/README.txt) 11 | 12 | ============== 13 | 14 | Example 01: Primitive rendering with animation and texturing. FBX loading, instancing and rendering. 15 | 16 | Example 02: Post processing with basic effects. 17 | 18 | Example 03: MSAA post processing, depth of field and reflection and refraction. 19 | 20 | Example 04: Dynamic environment mapping, alpha blending and animation paths. 21 | 22 | Example 05: Specular and displacement mapping. Debug output for lights and cameras. 23 | 24 | 25 | Test 01: FBX Export out of Blender and import into the Graphics Engine. 26 | 27 | Test 02: Shadow mapping. 28 | 29 | Test 03: Cascaded shadow mapping. 30 | 31 | Test 04: glTF export out of the Graphics Engine. 32 | 33 | Test 05: glTF import into the Graphics Engine. 34 | --------------------------------------------------------------------------------