├── .gitignore ├── Sources ├── Kore │ ├── Graphics4 │ │ ├── TextureArray.cpp │ │ ├── pch.h │ │ ├── TextureArray.h │ │ ├── Shader.h │ │ ├── Texture.cpp │ │ └── PipelineState.cpp │ ├── Math │ │ ├── pch.h │ │ ├── Core.cpp │ │ ├── Random.h │ │ ├── Quaternion.h │ │ ├── Random.cpp │ │ └── Core.h │ ├── IO │ │ ├── pch.h │ │ ├── FileWriter.h │ │ ├── BufferReader.h │ │ ├── FileWriter.cpp │ │ ├── Writer.h │ │ ├── FileReader.h │ │ └── BufferReader.cpp │ ├── Network │ │ ├── pch.h │ │ ├── Http.cpp │ │ ├── Http.h │ │ └── Socket.h │ ├── Vr │ │ ├── pch.h │ │ ├── SensorState.cpp │ │ ├── SensorState.h │ │ ├── VrPose.cpp │ │ ├── VrPose.h │ │ ├── VrPoseState.cpp │ │ ├── VrInterface.h │ │ ├── CameraImage.h │ │ └── VrPoseState.h │ ├── Audio1 │ │ ├── pch.h │ │ ├── Sound.h │ │ ├── SoundStream.h │ │ └── Audio.h │ ├── Audio2 │ │ ├── pch.h │ │ ├── Audio.cpp │ │ └── Audio.h │ ├── Audio3 │ │ ├── pch.h │ │ ├── Audio.cpp │ │ ├── TextToSpeech.h │ │ └── Audio.h │ ├── Graphics1 │ │ ├── pch.h │ │ ├── Graphics.h │ │ ├── Color.cpp │ │ ├── Color.h │ │ └── Image.h │ ├── Graphics2 │ │ └── pch.h │ ├── Graphics3 │ │ ├── pch.h │ │ ├── Graphics.cpp │ │ └── Texture.cpp │ ├── Graphics5 │ │ ├── pch.h │ │ ├── CommandList.cpp │ │ ├── VertexStructure.h │ │ ├── Shader.h │ │ ├── Graphics.cpp │ │ ├── Texture.cpp │ │ ├── ConstantBuffer.h │ │ └── PipelineState.cpp │ ├── Input │ │ ├── pch.h │ │ ├── Sensor.h │ │ ├── Surface.h │ │ ├── Gamepad.h │ │ ├── Gamepad.cpp │ │ ├── Pen.h │ │ ├── Surface.cpp │ │ ├── Keyboard.cpp │ │ ├── Pen.cpp │ │ └── Sensor.cpp │ ├── Log.h │ ├── LogArgs.h │ ├── Error.h │ ├── ErrorArgs.h │ ├── Threads │ │ ├── ThreadLocal.h │ │ ├── Event.h │ │ ├── Semaphore.h │ │ ├── Thread.h │ │ └── Mutex.h │ ├── Error.cpp │ ├── CodeStyle.cpp │ └── pch.h └── Shaders │ ├── painter-colored.frag.glsl │ ├── g1.frag.glsl │ ├── g1.vert.glsl │ ├── painter-text.frag.glsl │ ├── painter-video.frag.glsl │ ├── painter-image.frag.glsl │ ├── painter-colored.vert.glsl │ ├── painter-image.vert.glsl │ ├── painter-video.vert.glsl │ └── painter-text.vert.glsl ├── Backends ├── Audio2 │ ├── A2onA3 │ │ └── Sources │ │ │ └── Kore │ │ │ ├── Audio.cpp │ │ │ └── pch.h │ ├── WASAPI │ │ └── Sources │ │ │ └── Kore │ │ │ └── pch.h │ └── DirectSound │ │ └── Sources │ │ └── Kore │ │ └── pch.h ├── System │ ├── Pi │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── VideoSoundStream.h │ │ │ ├── Display.h │ │ │ ├── Video.h │ │ │ └── Input │ │ │ └── Mouse.cpp │ ├── Android │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── Vr │ │ │ ├── pch.h │ │ │ └── VrInterface.h │ │ │ ├── Display.h │ │ │ ├── Android.h │ │ │ ├── VideoSoundStream.h │ │ │ └── Video.h │ ├── Apple │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── VideoSoundStream.h │ │ │ └── Video.h │ ├── HTML5 │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── EventImpl.h │ │ │ ├── Event.cpp │ │ │ ├── VideoSoundStream.h │ │ │ ├── Input │ │ │ └── Mouse.cpp │ │ │ ├── Mutex.cpp │ │ │ └── Video.h │ ├── Linux │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── Input │ │ │ └── Gamepad.h │ │ │ ├── VideoSoundStream.h │ │ │ ├── Display_XRandr.cpp │ │ │ ├── Display.h │ │ │ └── Video.h │ ├── POSIX │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── EventImpl.h │ │ │ ├── MutexImpl.h │ │ │ ├── SemaphoreImpl.h │ │ │ ├── ThreadLocalImpl.h │ │ │ ├── ThreadLocal.cpp │ │ │ ├── Event.cpp │ │ │ ├── Semaphore.cpp │ │ │ └── Mutex.cpp │ ├── Tizen │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── AppResourceId.cpp │ │ │ ├── AppResourceId.h │ │ │ ├── tizenx.h │ │ │ ├── Audio.cpp │ │ │ ├── VideoSoundStream.h │ │ │ ├── OGLTemplateFrame.h │ │ │ ├── OGLTemplateFrame.cpp │ │ │ ├── Video.h │ │ │ ├── OGLTemplateEntry.cpp │ │ │ └── GlRendererTemplate.h │ ├── iOS │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── KoreAppDelegate.h │ │ │ ├── Display.h │ │ │ ├── Motion.h │ │ │ ├── GLViewController.h │ │ │ ├── Input │ │ │ └── Mouse.cpp │ │ │ ├── Display.cpp │ │ │ ├── Motion.mm │ │ │ ├── GLViewController.mm │ │ │ └── GLView.h │ ├── macOS │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── Input │ │ │ ├── pch.h │ │ │ ├── Mouse.cpp │ │ │ ├── HIDManager.h │ │ │ └── HIDGamepad.h │ │ │ ├── Display.h │ │ │ ├── mac.plist │ │ │ └── Display.mm │ ├── Windows │ │ ├── Sources │ │ │ └── Kore │ │ │ │ ├── pch.h │ │ │ │ ├── EventImpl.h │ │ │ │ ├── MutexImpl.h │ │ │ │ ├── SemaphoreImpl.h │ │ │ │ ├── ThreadLocalImpl.h │ │ │ │ ├── WinError.h │ │ │ │ ├── ThreadLocal.cpp │ │ │ │ ├── Event.cpp │ │ │ │ ├── Semaphore.cpp │ │ │ │ ├── VideoSoundStream.h │ │ │ │ ├── Video.h │ │ │ │ ├── Display.h │ │ │ │ ├── WinError.cpp │ │ │ │ └── Input │ │ │ │ └── Mouse.cpp │ │ └── Libraries │ │ │ ├── OculusSDK │ │ │ ├── LibOVR │ │ │ │ └── Src │ │ │ │ │ └── Resources │ │ │ │ │ └── Windows │ │ │ │ │ ├── resource.h │ │ │ │ │ └── Oculus.ico │ │ │ ├── LibOVRKernel │ │ │ │ └── Src │ │ │ │ │ ├── Tracing │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── LibOVREvents.rc │ │ │ │ │ ├── LibOVREventsTEMP.BIN │ │ │ │ │ ├── LibOVREvents_MSG00001.bin │ │ │ │ │ ├── clean.cmd │ │ │ │ │ ├── BUCK_WIN │ │ │ │ │ └── build.cmd │ │ │ │ │ ├── Util │ │ │ │ │ └── Shaders │ │ │ │ │ │ ├── Blt_ps.hlsl │ │ │ │ │ │ ├── Blt_vs.hlsl │ │ │ │ │ │ ├── Blt_ps_ms2.hlsl │ │ │ │ │ │ └── Blt_ps_ms4.hlsl │ │ │ │ │ └── GL │ │ │ │ │ └── BUCK_WIN │ │ │ ├── LICENSE.txt │ │ │ ├── Lib │ │ │ │ ├── x64 │ │ │ │ │ └── LibOVR.lib │ │ │ │ └── Win32 │ │ │ │ │ └── LibOVR.lib │ │ │ ├── Tools │ │ │ │ └── OculusVRCValidator │ │ │ │ │ ├── OculusVRCValidator.exe │ │ │ │ │ └── oculus-vrcvalidator.json │ │ │ └── Logging │ │ │ │ └── include │ │ │ │ └── BUCK_WIN │ │ │ ├── SteamVR │ │ │ ├── src │ │ │ │ └── vrcommon │ │ │ │ │ ├── hmderrors_public.h │ │ │ │ │ ├── envvartools_public.h │ │ │ │ │ ├── sharedlibtools_public.h │ │ │ │ │ ├── dirtools_public.h │ │ │ │ │ └── sharedlibtools_public.cpp │ │ │ └── README.md │ │ │ └── DirectShow │ │ │ └── BaseClasses │ │ │ ├── seekpt.h │ │ │ └── ddmm.h │ ├── WindowsApp │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── input │ │ │ ├── pch.h │ │ │ └── Mouse.cpp │ │ │ ├── EventImpl.h │ │ │ ├── MutexImpl.h │ │ │ ├── SemaphoreImpl.h │ │ │ ├── ThreadLocalImpl.h │ │ │ ├── WinError.h │ │ │ ├── Display.h │ │ │ ├── WinError.cpp │ │ │ ├── ThreadLocal.cpp │ │ │ ├── Event.cpp │ │ │ ├── VideoSoundStream.h │ │ │ ├── Semaphore.cpp │ │ │ ├── Mutex.winrt.cpp │ │ │ ├── Display.cpp │ │ │ └── Video.h │ └── Unreal │ │ └── Sources │ │ └── Kore │ │ ├── RHI.h │ │ ├── EventImpl.h │ │ ├── RenderTargetImpl.h │ │ ├── GraphicsImpl.h │ │ ├── ShaderImpl.cpp │ │ ├── Audio.cpp │ │ ├── ProgramImpl.h │ │ ├── ShaderImpl.h │ │ ├── Event.cpp │ │ ├── VideoSoundStream.h │ │ ├── IndexBufferImpl.h │ │ ├── Display.h │ │ ├── Input │ │ └── Mouse.cpp │ │ ├── Mutex.cpp │ │ ├── TextureImpl.h │ │ ├── VertexBufferImpl.h │ │ ├── Thread.cpp │ │ ├── RenderTargetImpl.cpp │ │ ├── Display.cpp │ │ └── Video.h ├── Audio3 │ └── A3onA2 │ │ └── Sources │ │ └── Kore │ │ └── pch.h ├── Graphics4 │ ├── Direct3D9 │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── GraphicsImpl.h │ │ │ ├── TextureArrayImpl.h │ │ │ ├── Direct3D9.h │ │ │ ├── TextureArrayImpl.cpp │ │ │ ├── RenderTargetImpl.h │ │ │ ├── PipelineStateImpl.h │ │ │ ├── TextureImpl.h │ │ │ ├── IndexBufferImpl.h │ │ │ ├── ShaderImpl.h │ │ │ └── VertexBufferImpl.h │ ├── G4onG5 │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── G4.h │ │ │ ├── GraphicsImpl.h │ │ │ ├── TextureArrayImpl.h │ │ │ ├── IndexBufferImpl.h │ │ │ ├── ShaderImpl.h │ │ │ ├── ComputeImpl.h │ │ │ ├── TextureArrayImpl.cpp │ │ │ ├── VertexBufferImpl.h │ │ │ ├── PipelineStateImpl.h │ │ │ ├── RenderTargetImpl.h │ │ │ ├── ShaderImpl.cpp │ │ │ ├── TextureImpl.h │ │ │ └── IndexBufferImpl.cpp │ ├── OpenGL │ │ └── Sources │ │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── OpenGL.h │ │ │ ├── GraphicsImpl.h │ │ │ ├── TextureArrayImpl.h │ │ │ ├── RenderTargetImpl.h │ │ │ ├── IndexBufferImpl.h │ │ │ ├── ShaderStorageBufferImpl.h │ │ │ ├── PipelineStateImpl.h │ │ │ ├── TextureImpl.h │ │ │ ├── ComputeImpl.h │ │ │ ├── ShaderImpl.h │ │ │ ├── VertexBufferImpl.h │ │ │ ├── ShaderImpl.cpp │ │ │ └── TextureArrayImpl.cpp │ └── Direct3D11 │ │ └── Sources │ │ └── Kore │ │ ├── pch.h │ │ ├── GraphicsImpl.h │ │ ├── Hololens.winrt.h │ │ ├── TextureArrayImpl.h │ │ ├── VertexBufferImpl.h │ │ ├── IndexBufferImpl.h │ │ ├── TextureImpl.h │ │ ├── RenderTargetImpl.h │ │ ├── ComputeImpl.h │ │ ├── Direct3D11.h │ │ ├── Conversion.winrt.h │ │ ├── PipelineStateImpl.h │ │ └── ShaderImpl.h ├── Graphics3 │ └── OpenGL1 │ │ └── Sources │ │ └── Kore │ │ ├── pch.h │ │ ├── OpenGL.h │ │ ├── GraphicsImpl.h │ │ ├── RenderTargetImpl.h │ │ ├── ShaderImpl.h │ │ ├── ComputeImpl.h │ │ ├── IndexBufferImpl.h │ │ ├── TextureImpl.h │ │ ├── ProgramImpl.h │ │ ├── ShaderImpl.cpp │ │ ├── VertexBufferImpl.h │ │ └── LightImpl.h └── Graphics5 │ ├── G5onG4 │ └── Sources │ │ └── Kore │ │ ├── pch.h │ │ ├── G5onG4.h │ │ ├── RenderTarget5Impl.h │ │ ├── Graphics5Impl.h │ │ ├── Shader5Impl.h │ │ ├── Texture5Impl.h │ │ ├── ConstantBuffer5Impl.h │ │ ├── IndexBuffer5Impl.h │ │ ├── CommandList5Impl.h │ │ ├── VertexBuffer5Impl.h │ │ ├── Shader5Impl.cpp │ │ ├── PipelineState5Impl.h │ │ ├── ConstantBuffer5Impl.cpp │ │ ├── IndexBuffer5Impl.cpp │ │ ├── RenderTarget5Impl.cpp │ │ ├── PipelineState5Impl.cpp │ │ ├── VertexBuffer5Impl.cpp │ │ └── Texture5Impl.cpp │ ├── Metal │ └── Sources │ │ └── Kore │ │ ├── pch.h │ │ ├── RenderTarget5Impl.h │ │ ├── Metal.h │ │ ├── Graphics5Impl.h │ │ ├── CommandList5Impl.h │ │ ├── Shader5Impl.h │ │ ├── Texture5Impl.h │ │ ├── IndexBuffer5Impl.h │ │ ├── VertexBuffer5Impl.h │ │ ├── PipelineState5Impl.h │ │ └── Shader5Impl.mm │ ├── Vulkan │ ├── Sources │ │ └── Kore │ │ │ ├── pch.h │ │ │ ├── Vulkan.h │ │ │ ├── Graphics5Impl.h │ │ │ ├── CommandList5Impl.h │ │ │ ├── Shader5Impl.h │ │ │ ├── RenderTarget5Impl.h │ │ │ ├── ConstantBuffer5Impl.h │ │ │ ├── Shader5Impl.cpp │ │ │ ├── IndexBuffer5Impl.h │ │ │ ├── VertexBuffer5Impl.h │ │ │ └── Texture5Impl.h │ └── Libraries │ │ ├── win32 │ │ └── vulkan-1.lib │ │ └── win64 │ │ └── vulkan-1.lib │ └── Direct3D12 │ └── Sources │ └── Kore │ ├── pch.h │ ├── Graphics5Impl.h │ ├── ConstantBuffer5Impl.h │ ├── CommandList5Impl.h │ ├── Shader5Impl.h │ ├── Direct3D12.h │ ├── Texture5Impl.h │ ├── IndexBuffer5Impl.h │ ├── VertexBuffer5Impl.h │ └── RenderTarget5Impl.h ├── Tests └── Empty │ ├── Sources │ ├── pch.h │ ├── shader.frag.glsl │ └── shader.vert.glsl │ ├── Deployment │ ├── keepme.txt │ ├── shader.frag │ └── shader.vert │ └── korefile.js ├── make.js ├── Tools └── yasm-1.2.0-win32.exe ├── .gitmodules ├── .travis.yml ├── appveyor.yml ├── updates.md ├── readme.md └── license.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/TextureArray.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Sources/Kore/Math/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" -------------------------------------------------------------------------------- /Backends/Audio2/A2onA3/Sources/Kore/Audio.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Sources/Kore/IO/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Network/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" -------------------------------------------------------------------------------- /Sources/Kore/Vr/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Audio1/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Audio2/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Audio3/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics1/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics2/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics3/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Sources/Kore/Input/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Tests/Empty/Sources/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /make.js: -------------------------------------------------------------------------------- 1 | require('./Tools/koremake/koremake.js'); 2 | -------------------------------------------------------------------------------- /Backends/System/Pi/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Audio2/A2onA3/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Audio2/WASAPI/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Audio3/A3onA2/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/Apple/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Tests/Empty/Deployment/keepme.txt: -------------------------------------------------------------------------------- 1 | Don't read me, but please keep me. -------------------------------------------------------------------------------- /Backends/Audio2/DirectSound/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/Vr/pch.h: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Input/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/input/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/AppResourceId.cpp: -------------------------------------------------------------------------------- 1 | #include "AppResourceId.h" 2 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVR/Src/Resources/Windows/resource.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/.gitignore: -------------------------------------------------------------------------------- 1 | LibOVRRT*.dll 2 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/CommandList.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "CommandList.h" 4 | -------------------------------------------------------------------------------- /Sources/Kore/Math/Core.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Sources/Kore/Math/Core.cpp -------------------------------------------------------------------------------- /Tools/yasm-1.2.0-win32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Tools/yasm-1.2.0-win32.exe -------------------------------------------------------------------------------- /Tests/Empty/Sources/shader.frag.glsl: -------------------------------------------------------------------------------- 1 | void kore() { 2 | gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); 3 | } 4 | -------------------------------------------------------------------------------- /Sources/Kore/Audio3/Audio.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Audio.h" 4 | 5 | using namespace Kore; 6 | -------------------------------------------------------------------------------- /Tests/Empty/Deployment/shader.frag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Tests/Empty/Deployment/shader.frag -------------------------------------------------------------------------------- /Tests/Empty/Deployment/shader.vert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Tests/Empty/Deployment/shader.vert -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/RHI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/G4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /Tests/Empty/Sources/shader.vert.glsl: -------------------------------------------------------------------------------- 1 | attribute vec3 pos; 2 | 3 | void kore() { 4 | gl_Position = vec4(pos.x, pos.y, 0.5, 1.0); 5 | } 6 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/G5onG4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/EventImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class EventImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/EventImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class EventImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/MutexImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class MutexImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/AppResourceId.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_RESOURCE_ID_H_ 2 | #define _APP_RESOURCE_ID_H_ 3 | 4 | #endif //_APP_RESOURCE_ID_H_ 5 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/EventImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class EventImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/EventImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class EventImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/MutexImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class MutexImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/RenderTarget5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class RenderTarget5Impl { 5 | public: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/SemaphoreImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class SemaphoreImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/EventImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class EventImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/MutexImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class MutexImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Libraries/win32/vulkan-1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/Graphics5/Vulkan/Libraries/win32/vulkan-1.lib -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Libraries/win64/vulkan-1.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/Graphics5/Vulkan/Libraries/win64/vulkan-1.lib -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/Input/Gamepad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | void initHIDGamepads(); 5 | void updateHIDGamepads(); 6 | } 7 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/ThreadLocalImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ThreadLocalImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/LICENSE.txt -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/SemaphoreImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class SemaphoreImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/ThreadLocalImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ThreadLocalImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/SemaphoreImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class SemaphoreImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/ThreadLocalImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ThreadLocalImpl { 5 | protected: 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/SensorState.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "SensorState.h" 4 | 5 | SensorState::SensorState() {} 6 | 7 | SensorState::~SensorState() {} 8 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/RenderTarget5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class RenderTarget5Impl { 5 | public: 6 | int stage; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/Lib/x64/LibOVR.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/Lib/x64/LibOVR.lib -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/OpenGL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/OpenGL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/Metal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/Vulkan.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/Lib/Win32/LibOVR.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/Lib/Win32/LibOVR.lib -------------------------------------------------------------------------------- /Sources/Kore/Audio3/TextToSpeech.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace TextToSpeech { 5 | void init(); 6 | void speakText(const char* text); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Kore/Log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | enum LogLevel { Info, Warning, Error }; 5 | 6 | void log(LogLevel level, const char* format, ...); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-colored.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec4 fragmentColor; 4 | out vec4 FragColor; 5 | 6 | void main() { 7 | FragColor = fragmentColor; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class RenderTargetImpl { 5 | public: 6 | bool antialiasing; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/LibOVREvents.rc: -------------------------------------------------------------------------------- 1 | LANGUAGE 0x9,0x1 2 | 1 11 "LibOVREvents_MSG00001.bin" 3 | 1 WEVT_TEMPLATE "LibOVREventsTEMP.BIN" 4 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/KoreAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class GLView; 4 | 5 | @interface KoreAppDelegate : NSObject { 6 | } 7 | 8 | @end -------------------------------------------------------------------------------- /Sources/Kore/LogArgs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Log.h" 4 | #include 5 | 6 | namespace Kore { 7 | void logArgs(LogLevel level, const char* format, va_list args); 8 | } 9 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "RenderTargetImpl.h" 5 | #include "ShaderImpl.h" 6 | #include "VertexBufferImpl.h" 7 | -------------------------------------------------------------------------------- /Sources/Shaders/g1.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform sampler2D tex; 4 | in vec2 texCoord; 5 | out vec4 FragColor; 6 | 7 | void main() { 8 | FragColor = texture(tex, texCoord); 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "RenderTargetImpl.h" 5 | #include "TextureImpl.h" 6 | #include "VertexBufferImpl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "RenderTargetImpl.h" 5 | #include "ShaderImpl.h" 6 | #include "VertexBufferImpl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "RenderTargetImpl.h" 5 | #include "TextureImpl.h" 6 | #include "VertexBufferImpl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "RenderTargetImpl.h" 5 | #include "TextureImpl.h" 6 | #include "VertexBufferImpl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/Graphics5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBuffer5Impl.h" 4 | #include "RenderTarget5Impl.h" 5 | #include "Texture5Impl.h" 6 | #include "VertexBuffer5Impl.h" 7 | -------------------------------------------------------------------------------- /Sources/Kore/Error.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | void affirm(bool); 5 | void affirm(bool, const char* format, ...); 6 | void error(); 7 | void error(const char* format, ...); 8 | } 9 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/Graphics5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBuffer5Impl.h" 4 | #include "RenderTarget5Impl.h" 5 | #include "Texture5Impl.h" 6 | #include "VertexBuffer5Impl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/Graphics5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBuffer5Impl.h" 4 | #include "RenderTarget5Impl.h" 5 | #include "Texture5Impl.h" 6 | #include "VertexBuffer5Impl.h" 7 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/Graphics5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBuffer5Impl.h" 4 | #include "RenderTarget5Impl.h" 5 | #include "Texture5Impl.h" 6 | #include "VertexBuffer5Impl.h" 7 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVR/Src/Resources/Windows/Oculus.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/LibOVR/Src/Resources/Windows/Oculus.ico -------------------------------------------------------------------------------- /Sources/Kore/Vr/SensorState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class SensorState { 6 | public: 7 | SensorState(); 8 | ~SensorState(); 9 | 10 | VrPoseState pose; 11 | }; 12 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/VrPose.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "VrPose.h" 4 | 5 | VrPose::VrPose() : orientation(Kore::Quaternion(0, 0, 0, 1)), position(Kore::vec3(0, 0, 0)), left(0), right(0), bottom(0), top(0) {} 6 | -------------------------------------------------------------------------------- /Sources/Shaders/g1.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 pos; 4 | in vec2 tex; 5 | out vec2 texCoord; 6 | 7 | void main() { 8 | gl_Position = vec4(pos.x, pos.y, 0.5, 1.0); 9 | texCoord = tex; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Kore/Math/Random.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Random { 5 | void init(int seed); 6 | s32 get(); 7 | s32 get(s32 max); 8 | s32 get(s32 min, s32 max); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/TextureArrayImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class TextureArrayImpl { 6 | public: 7 | void set(Kore::Graphics4::TextureUnit unit); 8 | }; 9 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/LibOVREventsTEMP.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/LibOVREventsTEMP.BIN -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/Tools/OculusVRCValidator/OculusVRCValidator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/Tools/OculusVRCValidator/OculusVRCValidator.exe -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/TextureArrayImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class TextureArrayImpl { 6 | public: 7 | void set(Kore::Graphics4::TextureUnit unit); 8 | }; 9 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/CommandList5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | class Shader; 8 | } 9 | 10 | class CommandList5Impl {}; 11 | } 12 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/LibOVREvents_MSG00001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hamaluik/Kore/master/Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/LibOVREvents_MSG00001.bin -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/clean.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM clean.cmd - remove generated ETW tracing files 4 | REM 5 | 6 | del LibOVREvents.h LibOVREvents.rc LibOVREvents*.bin *LibOVRRT*.dll 7 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/Logging/include/BUCK_WIN: -------------------------------------------------------------------------------- 1 | cxx_library( 2 | name = 'headers', 3 | exported_headers = glob( 4 | ['*.h'], 5 | ), 6 | header_namespace = '', 7 | visibility = ['PUBLIC'], 8 | ) -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/GraphicsImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IndexBufferImpl.h" 4 | #include "PipelineStateImpl.h" 5 | #include "RenderTargetImpl.h" 6 | #include "TextureImpl.h" 7 | #include "VertexBufferImpl.h" 8 | -------------------------------------------------------------------------------- /Sources/Kore/Audio2/Audio.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Audio.h" 4 | 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | void (*Audio2::audioCallback)(int samples) = nullptr; 10 | Audio2::Buffer Audio2::buffer; 11 | -------------------------------------------------------------------------------- /Sources/Kore/ErrorArgs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Error.h" 4 | #include 5 | 6 | namespace Kore { 7 | void affirmArgs(bool, const char* format, va_list args); 8 | void errorArgs(const char* format, va_list args); 9 | } 10 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/TextureArrayImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class TextureArrayImpl { 6 | public: 7 | unsigned texture; 8 | void set(Kore::Graphics4::TextureUnit unit); 9 | }; 10 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/WinError.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef long HRESULT; 6 | 7 | namespace Kore { 8 | void affirm(HRESULT result); 9 | void affirm(HRESULT result, const char* message); 10 | } 11 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Util/Shaders/Blt_ps.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D Input; 2 | sampler Sampler; 3 | 4 | float4 main(float4 pos : SV_POSITION, 5 | float2 tex : TEXCOORD) : SV_TARGET 6 | { 7 | return Input.Sample(Sampler, tex); 8 | } -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/WinError.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef long HRESULT; 6 | 7 | namespace Kore { 8 | void affirm(HRESULT result); 9 | void affirm(HRESULT result, const char* format, ...); 10 | } 11 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/ShaderImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | Shader::Shader(void* _data, int length, ShaderType type) {} 11 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | int count(); 6 | int x(int index); 7 | int y(int index); 8 | int height(int index); 9 | int width(int index); 10 | bool isPrimary(int index); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/Motion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import 3 | //#include 4 | 5 | @interface Motion : NSObject { 6 | // Kt::GyroHandler* gyroHandler; 7 | } 8 | 9 | // + (Motion*)the; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/Direct3D9.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef KORE_WINDOWS 7 | #include 8 | #endif 9 | 10 | extern IDirect3D9* d3d; 11 | extern IDirect3DDevice9* device; 12 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/Shader5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class Shader; 6 | } 7 | 8 | class Shader5Impl { 9 | public: 10 | Shader5Impl(); 11 | 12 | Graphics4::Shader* shader; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | int count(); 6 | int x(int index); 7 | int y(int index); 8 | int height(int index); 9 | int width(int index); 10 | bool isPrimary(int index); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | int count(); 6 | int x(int index); 7 | int y(int index); 8 | int height(int index); 9 | int width(int index); 10 | bool isPrimary(int index); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-text.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform sampler2D tex; 4 | in vec2 texCoord; 5 | in vec4 fragmentColor; 6 | out vec4 FragColor; 7 | 8 | void main() { 9 | FragColor = vec4(fragmentColor.rgb, texture(tex, texCoord).r * fragmentColor.a); 10 | } 11 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/src/vrcommon/hmderrors_public.h: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #pragma once 3 | 4 | const char *GetEnglishStringForHmdError( vr::EVRInitError eError ); 5 | const char *GetIDForVRInitError( vr::EVRInitError eError ); 6 | 7 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | int count(); 6 | int x(int index); 7 | int y(int index); 8 | int height(int index); 9 | int width(int index); 10 | bool isPrimary(int index); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class IndexBufferImpl { 7 | protected: 8 | IndexBufferImpl(int count); 9 | 10 | public: 11 | Graphics5::IndexBuffer _buffer; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Util/Shaders/Blt_vs.hlsl: -------------------------------------------------------------------------------- 1 | void main(float2 pos : POSITION, 2 | float2 tex : TEXCOORD, 3 | out float4 oPos : SV_POSITION, 4 | out float2 oTex : TEXCOORD) 5 | { 6 | oPos = float4(pos, 0, 1); 7 | oTex = tex; 8 | } -------------------------------------------------------------------------------- /Tests/Empty/korefile.js: -------------------------------------------------------------------------------- 1 | let project = new Project('Empty', __dirname); 2 | 3 | project.addFile('Sources/**'); 4 | project.setDebugDir('Deployment'); 5 | 6 | Project.createProject('../../', __dirname).then((kore) => { 7 | project.addSubProject(kore); 8 | resolve(project); 9 | }); 10 | -------------------------------------------------------------------------------- /Sources/Kore/Threads/ThreadLocal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class ThreadLocal : public ThreadLocalImpl { 7 | public: 8 | void create(); 9 | void destroy(); 10 | void* get(); 11 | void set(void*); 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class ShaderImpl { 7 | public: 8 | ShaderImpl(void* data, int length, Graphics5::ShaderType type); 9 | Graphics5::Shader _shader; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Audio.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | namespace {} 9 | 10 | void Audio::init() {} 11 | 12 | void Audio::update() {} 13 | 14 | void Audio::shutdown() {} 15 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-video.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform samplerVideo tex; 4 | in vec2 texCoord; 5 | in vec4 color; 6 | out vec4 FragColor; 7 | 8 | void main() { 9 | vec4 texcolor = texture(tex, texCoord) * color; 10 | texcolor.rgb *= color.a; 11 | FragColor = texcolor; 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-image.frag.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | uniform sampler2D tex; 4 | in vec2 texCoord; 5 | in vec4 color; 6 | out vec4 FragColor; 7 | 8 | 9 | void main() { 10 | vec4 texcolor = texture(tex, texCoord) * color; 11 | texcolor.rgb *= color.a; 12 | FragColor = texcolor; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/ComputeImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | class ComputeConstantLocationImpl {}; 8 | 9 | class ComputeTextureUnitImpl {}; 10 | 11 | class ComputeShaderImpl { 12 | public: 13 | ComputeShaderImpl(); 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-colored.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec4 vertexColor; 5 | uniform mat4 projectionMatrix; 6 | out vec4 fragmentColor; 7 | 8 | void main() { 9 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 10 | fragmentColor = vertexColor; 11 | } 12 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/BUCK_WIN: -------------------------------------------------------------------------------- 1 | cxx_library( 2 | name = 'headers', 3 | header_namespace = 'Tracing', 4 | exported_headers = [ 5 | 'Tracing.h', 6 | 'LibOVREvents.h', 7 | ], 8 | deps = [ 9 | ], 10 | visibility = ['PUBLIC'], 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/Hololens.winrt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef KORE_HOLOLENS 4 | 5 | #include "HolographicFrameController.winrt.h" 6 | 7 | extern std::unique_ptr holographicFrameController; 8 | extern std::shared_ptr videoFrameProcessor; 9 | 10 | #endif -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/src/vrcommon/envvartools_public.h: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #pragma once 3 | 4 | #include 5 | 6 | std::string GetEnvironmentVariable( const char *pchVarName ); 7 | bool SetEnvironmentVariable( const char *pchVarName, const char *pchVarValue ); 8 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/TextureArrayImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | using namespace Kore::Graphics4; 7 | 8 | TextureArray::TextureArray(Image** textures, int count) {} 9 | 10 | void TextureArrayImpl::set(TextureUnit unit) {} 11 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/TextureArrayImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | using namespace Kore::Graphics4; 7 | 8 | TextureArray::TextureArray(Image** textures, int count) {} 9 | 10 | void TextureArrayImpl::set(TextureUnit unit) {} 11 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/Texture5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class TextureUnit5Impl { 5 | public: 6 | int unit; 7 | }; 8 | 9 | class Texture5Impl { 10 | public: 11 | ~Texture5Impl(); 12 | void unmipmap(); 13 | void unset(); 14 | 15 | bool mipmap; 16 | int stage; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Kore/Threads/Event.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class Event : public EventImpl { 7 | public: 8 | void create(); 9 | void destroy(); 10 | void signal(); 11 | void wait(); 12 | bool tryToWait(double seconds); 13 | void reset(); 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/ConstantBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ConstantBuffer5Impl { 5 | public: 6 | ConstantBuffer5Impl(); 7 | 8 | protected: 9 | int lastStart; 10 | int lastCount; 11 | int mySize; 12 | const bool transposeMat3; 13 | const bool transposeMat4; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/ProgramImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RHIStaticStates.h" 4 | 5 | namespace Kore { 6 | class Shader; 7 | 8 | class ProgramImpl { 9 | public: 10 | Shader* vertexShader; 11 | Shader* fragmentShader; 12 | 13 | FVertexDeclarationRHIRef _vertexDeclaration; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/WinError.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "WinError.h" 4 | #define S_OK ((HRESULT)0L) 5 | 6 | void Kore::affirm(HRESULT result) { 7 | affirm(result == S_OK); 8 | } 9 | 10 | void Kore::affirm(HRESULT result, const char* message) { 11 | affirm(result == S_OK, message); 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/TextureArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Texture.h" 4 | 5 | #include 6 | 7 | namespace Kore { 8 | namespace Graphics4 { 9 | class TextureArray : public TextureArrayImpl { 10 | public: 11 | TextureArray(Image** textures, int count); 12 | }; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ShaderParameters.h" 4 | 5 | namespace Kore { 6 | class ConstantLocationImpl { 7 | public: 8 | FShaderParameter parameter; 9 | }; 10 | 11 | class AttributeLocationImpl {}; 12 | 13 | class ShaderImpl { 14 | public: 15 | void* shader; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics1/Graphics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics1 { 7 | void init(int width, int height); 8 | void begin(); 9 | void end(); 10 | void setPixel(int x, int y, float red, float green, float blue); 11 | int width(); 12 | int height(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/Android.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace KoreAndroid { 6 | // name in usual Java syntax (points, no slashes) 7 | jclass findClass(JNIEnv* env, const char* name); 8 | 9 | ANativeActivity* getActivity(); 10 | 11 | AAssetManager* getAssetManager(); 12 | } 13 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/ThreadLocal.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void ThreadLocal::create() {} 8 | 9 | void ThreadLocal::destroy() {} 10 | 11 | void* ThreadLocal::get() { 12 | return nullptr; 13 | } 14 | 15 | void ThreadLocal::set(void* data) {} 16 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/ThreadLocal.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void ThreadLocal::create() {} 8 | 9 | void ThreadLocal::destroy() {} 10 | 11 | void* ThreadLocal::get() { 12 | return nullptr; 13 | } 14 | 15 | void ThreadLocal::set(void* data) {} 16 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/ThreadLocal.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void ThreadLocal::create() {} 8 | 9 | void ThreadLocal::destroy() {} 10 | 11 | void* ThreadLocal::get() { 12 | return nullptr; 13 | } 14 | 15 | void ThreadLocal::set(void* data) {} 16 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/TextureArrayImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | struct ID3D11Texture2D; 6 | struct ID3D11ShaderResourceView; 7 | 8 | class TextureArrayImpl { 9 | public: 10 | ID3D11Texture2D* texture; 11 | ID3D11ShaderResourceView* view; 12 | void set(Kore::Graphics4::TextureUnit unit); 13 | }; 14 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/tizenx.h: -------------------------------------------------------------------------------- 1 | // precompiled header file 2 | #ifndef TIZENX_H_ 3 | #define TIZENX_H_ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Sources/Kore/Threads/Semaphore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class Semaphore : public SemaphoreImpl { 7 | public: 8 | void create(int current, int max); 9 | void destroy(); 10 | void release(int count = 1); 11 | void acquire(); 12 | bool tryToAcquire(double seconds); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/GLViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #ifndef SYS_TVOS 6 | #import 7 | #endif 8 | 9 | @interface GLViewController : UIViewController { 10 | @private 11 | } 12 | 13 | - (void)loadView; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Kore/Input/Sensor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | enum SensorType { SensorAccelerometer, SensorGyroscope }; 5 | 6 | class Sensor { 7 | public: 8 | static Sensor* the(SensorType type); 9 | void (*Changed)(float x, float y, float z); 10 | 11 | // for backend 12 | static void _changed(SensorType type, float x, float y, float z); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Kore/Network/Http.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Http.h" 4 | 5 | #if !defined KORE_MACOS && !defined KORE_IOS 6 | 7 | using namespace Kore; 8 | 9 | void Kore::httpRequest(const char* url, const char* path, const char* data, int port, bool secure, HttpMethod method, HttpCallback callback, 10 | void* callbackdata) {} 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-image.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 texPosition; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 color; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = texPosition; 13 | color = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-video.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 texPosition; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 color; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = texPosition; 13 | color = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/VrPose.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class VrPose { 7 | public: 8 | VrPose(); 9 | 10 | Kore::Quaternion orientation; 11 | Kore::vec3 position; 12 | 13 | Kore::mat4 eye; 14 | Kore::mat4 projection; 15 | 16 | // fov 17 | float left; 18 | float right; 19 | float bottom; 20 | float top; 21 | }; 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Tools/koremake"] 2 | path = Tools/koremake 3 | url = https://github.com/Kode/koremake.git 4 | branch = master 5 | [submodule "Tools/kraffiti"] 6 | path = Tools/kraffiti 7 | url = https://github.com/Kode/kraffiti_bin.git 8 | branch = master 9 | [submodule "Tools/krafix"] 10 | path = Tools/krafix 11 | url = https://github.com/Kode/krafix_bin.git 12 | branch = master 13 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class RenderTargetImpl { 5 | public: 6 | unsigned _framebuffer; 7 | unsigned _texture; 8 | unsigned _depthTexture; 9 | // unsigned _depthRenderbuffer; 10 | int contextId; 11 | void setupDepthStencil(int depthBufferBits, int stencilBufferBits, int width, int height); 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/ConstantBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12Resource; 4 | 5 | namespace Kore { 6 | class ConstantBuffer5Impl { 7 | public: 8 | ID3D12Resource* _buffer; 9 | 10 | protected: 11 | int lastStart; 12 | int lastCount; 13 | int mySize; 14 | const bool transposeMat3 = false; 15 | const bool transposeMat4 = false; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/IndexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class IndexBuffer; 6 | } 7 | 8 | class IndexBuffer5Impl { 9 | protected: 10 | IndexBuffer5Impl(int count, bool gpuMemory); 11 | 12 | public: 13 | Graphics4::IndexBuffer* buffer; 14 | int myCount; 15 | static IndexBuffer5Impl* _current; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/Event.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Event::create() {} 8 | 9 | void Event::destroy() {} 10 | 11 | void Event::signal() {} 12 | 13 | void Event::wait() {} 14 | 15 | bool Event::tryToWait(double seconds) { 16 | return true; 17 | } 18 | 19 | void Event::reset() {} 20 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/Event.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Event::create() {} 8 | 9 | void Event::destroy() {} 10 | 11 | void Event::signal() {} 12 | 13 | void Event::wait() {} 14 | 15 | bool Event::tryToWait(double seconds) { 16 | return true; 17 | } 18 | 19 | void Event::reset() {} 20 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Event.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Event::create() {} 8 | 9 | void Event::destroy() {} 10 | 11 | void Event::signal() {} 12 | 13 | void Event::wait() {} 14 | 15 | bool Event::tryToWait(double seconds) { 16 | return true; 17 | } 18 | 19 | void Event::reset() {} 20 | -------------------------------------------------------------------------------- /Sources/Kore/IO/FileWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Writer.h" 4 | 5 | namespace Kore { 6 | class FileWriter : public Writer { 7 | public: 8 | FileWriter(); 9 | FileWriter(const char* filename); 10 | ~FileWriter(); 11 | bool open(const char* filename); 12 | void close(); 13 | void write(void* data, int size) override; 14 | 15 | private: 16 | void* file; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Shaders/painter-text.vert.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | 3 | in vec3 vertexPosition; 4 | in vec2 texPosition; 5 | in vec4 vertexColor; 6 | uniform mat4 projectionMatrix; 7 | out vec2 texCoord; 8 | out vec4 fragmentColor; 9 | 10 | void main() { 11 | gl_Position = projectionMatrix * vec4(vertexPosition, 1.0); 12 | texCoord = texPosition; 13 | fragmentColor = vertexColor; 14 | } 15 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/Event.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Event::create() {} 8 | 9 | void Event::destroy() {} 10 | 11 | void Event::signal() {} 12 | 13 | void Event::wait() {} 14 | 15 | bool Event::tryToWait(double seconds) { 16 | return true; 17 | } 18 | 19 | void Event::reset() {} 20 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Event.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Event::create() {} 8 | 9 | void Event::destroy() {} 10 | 11 | void Event::signal() {} 12 | 13 | void Event::wait() {} 14 | 15 | bool Event::tryToWait(double seconds) { 16 | return true; 17 | } 18 | 19 | void Event::reset() {} 20 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D11Buffer; 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class VertexBuffer; 8 | } 9 | 10 | class VertexBufferImpl { 11 | public: 12 | ID3D11Buffer* _vb; 13 | int myStride; 14 | 15 | protected: 16 | VertexBufferImpl(int count); 17 | int myCount; 18 | float* vertices; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/Audio.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include 3 | 4 | using namespace Kore; 5 | 6 | void Kore::Audio::init() { 7 | buffer.readLocation = 0; 8 | buffer.writeLocation = 0; 9 | buffer.dataSize = 128 * 1024; 10 | buffer.data = new u8[buffer.dataSize]; 11 | } 12 | 13 | void Kore::Audio::update() {} 14 | 15 | void Kore::Audio::shutdown() {} 16 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/src/vrcommon/sharedlibtools_public.h: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #pragma once 3 | 4 | typedef void *SharedLibHandle; 5 | 6 | SharedLibHandle SharedLib_Load( const char *pchPath ); 7 | void *SharedLib_GetFunction( SharedLibHandle lib, const char *pchFunctionName); 8 | void SharedLib_Unload( SharedLibHandle lib ); 9 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Kore/Threads/Thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | const uint MAX_THREADS = 8; 5 | 6 | class Thread { 7 | public: 8 | }; 9 | 10 | void threadsInit(); 11 | void threadsQuit(); 12 | 13 | Thread* createAndRunThread(void (*thread)(void* param), void* param); 14 | void waitForThreadStopThenFree(Thread* sr); 15 | bool isThreadStoppedThenFree(Thread* sr); 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/CommandList5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics5 { 5 | class PipelineState; 6 | } 7 | } 8 | 9 | class CommandList5Impl { 10 | public: 11 | Kore::Graphics5::PipelineState* _currentPipeline; 12 | int _indexCount; 13 | Kore::s64 commands[1024]; 14 | int commandIndex; 15 | 16 | protected: 17 | bool closed; 18 | }; 19 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/VertexStructure.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | typedef Graphics4::VertexData VertexData; 8 | 9 | typedef Graphics4::VertexAttribute VertexAttribute; 10 | 11 | typedef Graphics4::VertexElement VertexElement; 12 | 13 | typedef Graphics4::VertexStructure VertexStructure; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/System/Pi/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct IDirect3DSurface9; 4 | struct IDirect3DTexture9; 5 | 6 | namespace Kore { 7 | class RenderTargetImpl { 8 | public: 9 | IDirect3DSurface9* colorSurface; 10 | IDirect3DSurface9* depthSurface; 11 | IDirect3DTexture9* colorTexture; 12 | IDirect3DTexture9* depthTexture; 13 | bool antialiasing; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/CommandList5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "vulkan_mini.h" 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | class PipelineState; 8 | } 9 | } 10 | 11 | class CommandList5Impl { 12 | public: 13 | Kore::Graphics5::PipelineState* _currentPipeline; 14 | int _indexCount; 15 | VkCommandBuffer _buffer; 16 | 17 | protected: 18 | bool closed; 19 | }; 20 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq) {} 8 | void insertData(float* data, int nSamples) {} 9 | float nextSample() { 10 | return 0; 11 | } 12 | bool ended() { 13 | return true; 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class Program; 6 | } 7 | 8 | class ProgramImpl; 9 | 10 | class ShaderImpl { 11 | public: 12 | ShaderImpl(void* source, int length); 13 | virtual ~ShaderImpl(); 14 | uint id; 15 | char* source; 16 | int length; 17 | friend class Program; 18 | friend class ProgramImpl; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D11Buffer; 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class IndexBuffer; 8 | } 9 | 10 | class IndexBufferImpl { 11 | protected: 12 | IndexBufferImpl(int count); 13 | ID3D11Buffer* ib; 14 | int* indices; 15 | int myCount; 16 | 17 | public: 18 | static Graphics4::IndexBuffer* _current; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/PipelineStateImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct IDirect3DVertexDeclaration9; 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class PipelineState; 8 | } 9 | 10 | class PipelineStateImpl { 11 | public: 12 | IDirect3DVertexDeclaration9* vertexDecleration; 13 | int halfPixelLocation; 14 | void set(Graphics4::PipelineState* pipeline); 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/Semaphore.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Semaphore::create(int current, int max) {} 8 | 9 | void Semaphore::destroy() {} 10 | 11 | void Semaphore::release(int count) {} 12 | 13 | void Semaphore::acquire() {} 14 | 15 | bool Semaphore::tryToAcquire(double seconds) { 16 | return true; 17 | } 18 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | class IndexBuffer; 8 | 9 | class IndexBufferImpl { 10 | protected: 11 | IndexBufferImpl(int count); 12 | int myCount; 13 | 14 | public: 15 | static IndexBuffer* _current; 16 | FIndexBufferRHIRef indexBuffer; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/Semaphore.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Semaphore::create(int current, int max) {} 8 | 9 | void Semaphore::destroy() {} 10 | 11 | void Semaphore::release(int count) {} 12 | 13 | void Semaphore::acquire() {} 14 | 15 | bool Semaphore::tryToAcquire(double seconds) { 16 | return true; 17 | } 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | dist: precise 3 | os: 4 | - linux 5 | - osx 6 | addons: 7 | apt: 8 | packages: 9 | - libasound2-dev 10 | language: cpp 11 | before_script: 12 | - git submodule update --init --recursive 13 | - git clone https://github.com/ktxsoftware/nodejs_bin.git 14 | - nodejs_bin/copysysbin.sh 15 | script: nodejs_bin/node make.js --kore . --from Tests/Empty --noshaders --compile 16 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Semaphore.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Semaphore::create(int current, int max) {} 8 | 9 | void Semaphore::destroy() {} 10 | 11 | void Semaphore::release(int count) {} 12 | 13 | void Semaphore::acquire() {} 14 | 15 | bool Semaphore::tryToAcquire(double seconds) { 16 | return true; 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct IDirect3DTexture9; 4 | 5 | namespace Kore { 6 | class TextureUnitImpl { 7 | public: 8 | int unit; 9 | }; 10 | 11 | class TextureImpl { 12 | public: 13 | IDirect3DTexture9* texture; 14 | virtual ~TextureImpl(); 15 | void unmipmap(); 16 | void unset(); 17 | int stage; 18 | bool mipmap; 19 | u8 pixfmt; 20 | int pitch; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/Shader5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | class Program; 8 | } 9 | 10 | class Program5Impl; 11 | 12 | class Shader5Impl { 13 | public: 14 | Shader5Impl(void* source, int length); 15 | char name[1024]; 16 | id mtlFunction; 17 | friend class Graphics5::Program; 18 | friend class Program5Impl; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Sources/Kore/Network/Http.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | enum HttpMethod { GET, POST, PUT, DELETE }; 5 | 6 | typedef void (*HttpCallback)(int error, int response, const char* body, void* callbackdata); 7 | 8 | void httpRequest(const char* url, const char* path, const char* data, int port = 80, bool secure = false, HttpMethod method = GET, 9 | HttpCallback callback = 0, void* callbackdata = 0); 10 | } 11 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | struct DeviceInfo { 6 | DeviceInfo() {} 7 | }; 8 | 9 | void enumerate(); 10 | const DeviceInfo* primary(); 11 | const DeviceInfo* byId(int id); 12 | int height(int index); 13 | int width(int index); 14 | int x(int index); 15 | int y(int index); 16 | bool isPrimary(int index); 17 | int count(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | class VideoSoundStream { 8 | public: 9 | VideoSoundStream(int nChannels, int freq) {} 10 | void insertData(float* data, int nSamples) {} 11 | float nextSample() { 12 | return 0; 13 | } 14 | bool ended() { 15 | return true; 16 | } 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Kore/Audio1/Sound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | struct Sound { 7 | public: 8 | Sound(const char* filename); 9 | ~Sound(); 10 | Audio2::BufferFormat format; 11 | float volume(); 12 | void setVolume(float value); 13 | s16* left; 14 | s16* right; 15 | int size; 16 | float sampleRatePos; 17 | 18 | private: 19 | float myVolume; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/VertexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class VertexBuffer; 6 | } 7 | 8 | class VertexBuffer5Impl { 9 | protected: 10 | VertexBuffer5Impl(int count); 11 | 12 | public: 13 | Graphics4::VertexBuffer* buffer; 14 | int myCount; 15 | int myStride; 16 | int myStart; 17 | // float* vertices; 18 | static VertexBuffer5Impl* _current; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/Shader5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics5 { 5 | class Program; 6 | } 7 | 8 | class Program5Impl; 9 | 10 | class Shader5Impl { 11 | public: 12 | Shader5Impl(void* source, int length); 13 | virtual ~Shader5Impl(); 14 | uint id; 15 | char* source; 16 | int length; 17 | friend class Program; 18 | friend class ProgramImpl; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/src/vrcommon/dirtools_public.h: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #pragma once 3 | 4 | #include 5 | #include 6 | 7 | 8 | #if !defined(_WIN32) 9 | #include 10 | #include 11 | #endif 12 | 13 | 14 | extern bool BCreateDirectoryRecursive( const char *pchPath ); 15 | extern bool BCreateDirectory( const char *pchPath ); 16 | 17 | 18 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Surface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Surface { 5 | public: 6 | static Surface* the(); 7 | void (*Move)(int index, int x, int y); 8 | void (*TouchStart)(int index, int x, int y); 9 | void (*TouchEnd)(int index, int x, int y); 10 | 11 | // for backend 12 | void _move(int index, int x, int y); 13 | void _touchStart(int index, int x, int y); 14 | void _touchEnd(int index, int x, int y); 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/Texture5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | namespace Graphics5 { 8 | class Texture; 9 | } 10 | 11 | class TextureUnit5Impl { 12 | public: 13 | int index; 14 | }; 15 | 16 | class Texture5Impl { 17 | public: 18 | ~Texture5Impl(); 19 | id tex; 20 | 21 | protected: 22 | void create(int width, int height); 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | void Mouse::_lock(int windowId, bool truth) {} 9 | 10 | bool Mouse::canLock(int windowId) { 11 | return true; 12 | } 13 | 14 | void Mouse::show(bool truth) {} 15 | 16 | void Mouse::setPosition(int windowId, int x, int y) {} 17 | 18 | void Mouse::getPosition(int windowId, int& x, int& y) {} 19 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class RenderTargetImpl { 5 | public: 6 | unsigned _framebuffer; 7 | unsigned _texture; 8 | unsigned _depthTexture; 9 | bool _hasDepth; 10 | // unsigned _depthRenderbuffer; 11 | int contextId; 12 | int format; 13 | void setupDepthStencil(unsigned int texType, int depthBufferBits, int stencilBufferBits, int width, int height); 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/Shader5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | Shader5Impl::Shader5Impl() {} 11 | 12 | Graphics5::Shader::Shader(void* _data, int length, ShaderType type) { 13 | shader = new Graphics4::Shader(_data, length, type == VertexShader ? Graphics4::VertexShader : Graphics4::FragmentShader); 14 | } 15 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/IndexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | class IndexBuffer; 8 | } 9 | 10 | class IndexBuffer5Impl { 11 | protected: 12 | public: 13 | IndexBuffer5Impl(int count); 14 | void unset(); 15 | int offset(); 16 | id mtlBuffer; 17 | int myCount; 18 | int index; 19 | 20 | public: 21 | static Graphics5::IndexBuffer* current; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Gamepad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Gamepad { 5 | public: 6 | static Gamepad* get(int num); 7 | void (*Axis)(int, float); 8 | void (*Button)(int, float); 9 | 10 | // called by backend 11 | void _axis(int axis, float value); 12 | void _button(int button, float value); 13 | 14 | const char* vendor; 15 | const char* productName; 16 | 17 | Gamepad() : vendor(nullptr), productName(nullptr) {} 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/VrPoseState.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "VrPoseState.h" 4 | 5 | VrPoseState::VrPoseState() 6 | : angularVelocity(Kore::vec3(0, 0, 0)), linearVelocity(Kore::vec3(0, 0, 0)), angularAcceleration(Kore::vec3(0, 0, 0)), 7 | linearAcceleration(Kore::vec3(0, 0, 0)), trackedDevice(HMD), isVisible(false), hmdPresenting(false), hmdMounted(false), displayLost(false), 8 | shouldQuit(false), shouldRecenter(false) {} 9 | 10 | VrPoseState::~VrPoseState() {} 11 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | platform: 3 | - Win32 4 | - x64 5 | environment: 6 | matrix: 7 | - platform_name: windows 8 | - platform_name: windowsapp 9 | before_build: 10 | - git submodule update --init --recursive 11 | - git clone https://github.com/ktxsoftware/nodejs_bin.git 12 | - nodejs_bin\node.exe make.js %platform_name% --kore . --from Tests/Empty --visualstudio vs2015 --noshaders 13 | build: 14 | project: build\Empty.sln 15 | verbosity: minimal -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/ComputeImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ComputeConstantLocationImpl { 5 | public: 6 | int location; 7 | }; 8 | 9 | class ComputeTextureUnitImpl { 10 | public: 11 | int unit; 12 | }; 13 | 14 | class ComputeShaderImpl { 15 | public: 16 | ComputeShaderImpl(void* source, int length); 17 | virtual ~ComputeShaderImpl(); 18 | uint _id; 19 | uint _programid; 20 | char* _source; 21 | int _length; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class IndexBuffer; 6 | } 7 | 8 | class IndexBufferImpl { 9 | protected: 10 | public: 11 | IndexBufferImpl(int count); 12 | void unset(); 13 | 14 | #if defined(KORE_ANDROID) || defined(KORE_PI) 15 | u16* shortData; 16 | #endif 17 | int* data; 18 | int myCount; 19 | uint bufferId; 20 | 21 | public: 22 | static Graphics4::IndexBuffer* current; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics3 { 5 | class IndexBuffer; 6 | } 7 | 8 | class IndexBufferImpl { 9 | protected: 10 | public: 11 | IndexBufferImpl(int count); 12 | void unset(); 13 | 14 | #if defined(KORE_ANDROID) || defined(KORE_PI) 15 | u16* shortData; 16 | #endif 17 | int* data; 18 | int myCount; 19 | uint bufferId; 20 | 21 | public: 22 | static Graphics3::IndexBuffer* current; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/ShaderStorageBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class ShaderStorageBuffer; 7 | 8 | class ShaderStorageBufferImpl { 9 | protected: 10 | public: 11 | ShaderStorageBufferImpl(int count, Graphics4::VertexData type); 12 | void unset(); 13 | 14 | int* data; 15 | int myCount; 16 | int myStride; 17 | uint bufferId; 18 | 19 | public: 20 | static ShaderStorageBuffer* current; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include 3 | 4 | using namespace Kore; 5 | 6 | void Mouse::_lock(int window, bool truth) { 7 | // TODO 8 | } 9 | 10 | bool Mouse::canLock(int window) { 11 | return false; // FOR NOW 12 | } 13 | 14 | void Mouse::show(bool truth) { 15 | // TODO 16 | } 17 | 18 | void Mouse::setPosition(int window, int x, int y) { 19 | // TODO 20 | } 21 | 22 | void Mouse::getPosition(int window, int& x, int& y) { 23 | // TODO 24 | } 25 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Mutex.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | void Mutex::create() {} 9 | 10 | void Mutex::destroy() {} 11 | 12 | void Mutex::lock() {} 13 | 14 | void Mutex::unlock() {} 15 | 16 | bool UberMutex::create(const wchar_t* name) { 17 | return false; 18 | } 19 | 20 | void UberMutex::destroy() {} 21 | 22 | void UberMutex::lock() {} 23 | 24 | void UberMutex::unlock() {} 25 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Gamepad.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Gamepad.h" 4 | 5 | using namespace Kore; 6 | 7 | namespace { 8 | Gamepad pads[12]; 9 | } 10 | 11 | Gamepad* Gamepad::get(int num) { 12 | return &pads[num]; 13 | } 14 | 15 | void Gamepad::_axis(int axis, float value) { 16 | if (Axis != nullptr) { 17 | Axis(axis, value); 18 | } 19 | } 20 | 21 | void Gamepad::_button(int button, float value) { 22 | if (Button != nullptr) { 23 | Button(button, value); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include 3 | 4 | using namespace Kore; 5 | 6 | void Mouse::_lock(int windowId, bool truth) { 7 | // TODO 8 | } 9 | 10 | bool Mouse::canLock(int windowId) { 11 | return false; // FOR NOW 12 | } 13 | 14 | void Mouse::show(bool truth) { 15 | // TODO 16 | } 17 | 18 | void Mouse::setPosition(int windowId, int x, int y) { 19 | // TODO 20 | } 21 | 22 | void Mouse::getPosition(int windowId, int& x, int& y) { 23 | // TODO 24 | } 25 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include 3 | 4 | using namespace Kore; 5 | 6 | void Mouse::_lock(int windowId, bool truth) { 7 | // TODO 8 | } 9 | 10 | bool Mouse::canLock(int windowId) { 11 | return false; // FOR NOW 12 | } 13 | 14 | void Mouse::show(bool truth) { 15 | // TODO 16 | } 17 | 18 | void Mouse::setPosition(int windowId, int x, int y) { 19 | // TODO 20 | } 21 | 22 | void Mouse::getPosition(int windowId, int& x, int& y) { 23 | // TODO 24 | } 25 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics1/Color.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Color.h" 4 | 5 | using namespace Kore; 6 | 7 | Graphics1::Color::Color(uint color) { 8 | getColorFromHex(color, R, G, B, A); 9 | } 10 | 11 | void Graphics1::Color::getColorFromHex(uint color, float& red, float& green, float& blue, float& alpha) { 12 | alpha = ((color & 0xff000000) >> 24) / 255.0f; 13 | red = ((color & 0x00ff0000) >> 16) / 255.0f; 14 | green = ((color & 0x0000ff00) >> 8) / 255.0f; 15 | blue = (color & 0x000000ff) / 255.0f; 16 | } 17 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/PipelineStateImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class PipelineState; 6 | class Shader; 7 | } 8 | 9 | class PipelineStateImpl { 10 | public: 11 | uint programId; 12 | 13 | PipelineStateImpl(); 14 | virtual ~PipelineStateImpl(); 15 | int findTexture(const char* name); 16 | char** textures; 17 | int* textureValues; 18 | int textureCount; 19 | void set(Graphics4::PipelineState* pipeline); 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics3 { 7 | class Texture; 8 | } 9 | 10 | class TextureUnitImpl { 11 | public: 12 | int unit; 13 | }; 14 | 15 | class TextureImpl { 16 | protected: 17 | // static TreeMap images; 18 | public: 19 | unsigned int texture; 20 | #ifdef KORE_ANDROID 21 | bool external_oes; 22 | #endif 23 | 24 | u8 pixfmt; 25 | 26 | ~TextureImpl(); 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class Texture; 8 | } 9 | 10 | class TextureUnitImpl { 11 | public: 12 | int unit; 13 | }; 14 | 15 | class TextureImpl { 16 | protected: 17 | // static TreeMap images; 18 | public: 19 | unsigned int texture; 20 | #ifdef KORE_ANDROID 21 | bool external_oes; 22 | #endif 23 | 24 | u8 pixfmt; 25 | 26 | ~TextureImpl(); 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/VertexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | namespace Graphics5 { 8 | class VertexBuffer; 9 | } 10 | 11 | class VertexBuffer5Impl { 12 | protected: 13 | VertexBuffer5Impl(int count); 14 | void unset(); 15 | int offset(); 16 | int myCount; 17 | int myStride; 18 | int index; 19 | id mtlBuffer; 20 | 21 | public: 22 | static Graphics5::VertexBuffer* current; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | void Mouse::_lock(int windowId, bool truth) { 8 | // TODO 9 | } 10 | 11 | bool Mouse::canLock(int windowId) { 12 | return false; // FOR NOW 13 | } 14 | 15 | void Mouse::show(bool truth) { 16 | // TODO 17 | } 18 | 19 | void Mouse::setPosition(int windowId, int x, int y) { 20 | // TODO 21 | } 22 | 23 | void Mouse::getPosition(int windowId, int& x, int& y) { 24 | // TODO 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/IndexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#include 4 | 5 | #ifdef KORE_WINDOWS 6 | struct IDirect3DIndexBuffer9; 7 | #endif 8 | 9 | namespace Kore { 10 | namespace Graphics4 { 11 | class IndexBuffer; 12 | } 13 | 14 | class IndexBufferImpl { 15 | protected: 16 | IndexBufferImpl(int count); 17 | #ifdef KORE_WINDOWS 18 | IDirect3DIndexBuffer9* ib; 19 | #endif 20 | int myCount; 21 | 22 | public: 23 | static Graphics4::IndexBuffer* _current; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/CommandList5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12CommandAllocator; 4 | struct ID3D12GraphicsCommandList; 5 | 6 | namespace Kore { 7 | namespace Graphics5 { 8 | class PipelineState; 9 | } 10 | } 11 | 12 | class CommandList5Impl { 13 | public: 14 | ID3D12CommandAllocator* _commandAllocator; 15 | ID3D12GraphicsCommandList* _commandList; 16 | Kore::Graphics5::PipelineState* _currentPipeline; 17 | int _indexCount; 18 | 19 | protected: 20 | bool closed; 21 | }; 22 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/Shader5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | struct ShaderConstant { 8 | u32 offset; 9 | u32 size; 10 | }; 11 | 12 | class Shader5Impl { 13 | public: 14 | Shader5Impl(); 15 | std::map constants; 16 | int constantsSize; 17 | std::map attributes; 18 | std::map textures; 19 | void* shader; 20 | u8* data; 21 | int length; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ShaderParameters.h" 4 | 5 | #include "Engine/Texture2D.h" 6 | 7 | namespace Kore { 8 | class TextureUnitImpl { 9 | public: 10 | FShaderResourceParameter parameter; 11 | FShaderResourceParameter sampler; 12 | }; 13 | 14 | class TextureImpl { 15 | public: 16 | virtual ~TextureImpl(); 17 | void unmipmap(); 18 | void unset(); 19 | int stage; 20 | bool mipmap; 21 | u8 pixfmt; 22 | int pitch; 23 | 24 | FTexture2DRHIRef _tex; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /Sources/Kore/IO/BufferReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | 7 | class BufferReader : public Reader { 8 | u8* buffer; 9 | int bufferSize; 10 | int position; 11 | void* readAllBuffer; 12 | 13 | public: 14 | BufferReader(void const* buffer, int size); 15 | virtual ~BufferReader(); 16 | int read(void* data, int size) override; 17 | void* readAll() override; 18 | int size() const override; 19 | int pos() const override; 20 | void seek(int pos) override; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/Direct3D12.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #ifdef KORE_WINDOWS 7 | #include "d3dx12.h" 8 | #endif 9 | 10 | #ifndef IID_GRAPHICS_PPV_ARGS 11 | #define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x) 12 | #endif 13 | 14 | static const int QUEUE_SLOT_COUNT = 3; 15 | extern int currentBackBuffer; 16 | extern ID3D12Device* device; 17 | extern ID3D12RootSignature* rootSignature; 18 | // extern ID3D12GraphicsCommandList* commandList; 19 | -------------------------------------------------------------------------------- /Backends/System/Apple/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq); 8 | void insertData(float* data, int nSamples); 9 | float nextSample(); 10 | bool ended(); 11 | // void* audioTrackOutput; 12 | private: 13 | float* buffer; 14 | const int bufferSize; 15 | int bufferWritePosition; 16 | int bufferReadPosition; 17 | u64 read; 18 | u64 written; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | class VertexBuffer; 8 | 9 | class VertexBufferImpl { 10 | protected: 11 | int myCount; 12 | int myStride; 13 | int instanceDataStepRate; 14 | VertexBufferImpl(int count, int instanceDataStepRate); 15 | void unset(); 16 | FVertexBufferRHIRef vertexBuffer; 17 | 18 | public: 19 | static VertexBuffer* _current; 20 | int _offset; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/VideoSoundStream.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream { 6 | public: 7 | VideoSoundStream(int nChannels, int freq); 8 | void insertData(float* data, int nSamples); 9 | float nextSample(); 10 | bool ended(); 11 | void* audioTrackOutput; 12 | 13 | private: 14 | float* buffer; 15 | const int bufferSize; 16 | int bufferWritePosition; 17 | int bufferReadPosition; 18 | u64 read; 19 | u64 written; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/PipelineState5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics5 { 7 | class Shader; 8 | } 9 | 10 | class PipelineState5Impl { 11 | protected: 12 | Graphics5::Shader* vertexShader; 13 | Graphics5::Shader* fragmentShader; 14 | id pipeline; 15 | id reflection; 16 | PipelineState5Impl(); 17 | 18 | public: 19 | void _set(); 20 | }; 21 | 22 | class ConstantLocation5Impl { 23 | public: 24 | int vertexOffset; 25 | int fragmentOffset; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Kore/Audio2/Audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Audio2 { 5 | void init(); 6 | void update(); 7 | void shutdown(); 8 | 9 | extern void (*audioCallback)(int samples); 10 | 11 | struct BufferFormat { 12 | int channels; 13 | int samplesPerSecond; 14 | int bitsPerSample; 15 | }; 16 | 17 | struct Buffer { 18 | BufferFormat format; 19 | u8* data; 20 | int dataSize; 21 | int readLocation; 22 | int writeLocation; 23 | }; 24 | 25 | extern Buffer buffer; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Pen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Pen { 5 | public: 6 | Pen(); 7 | static Pen* the(); 8 | void (*Move)(int windowId, int x, int y, float pressure); 9 | void (*Press)(int windowId, int x, int y, float pressure); 10 | void (*Release)(int windowId, int x, int y, float pressure); 11 | 12 | // For backend 13 | void _move(int windowId, int x, int y, float pressure); 14 | void _press(int windowId, int x, int y, float pressure); 15 | void _release(int windowId, int x, int y, float pressure); 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class VertexStructure; 8 | } 9 | 10 | class VertexBufferImpl { 11 | protected: 12 | VertexBufferImpl(int count, const Graphics4::VertexStructure& structure, int instanceDataStepRate); 13 | int myCount; 14 | void prepareLock(); 15 | 16 | public: 17 | Graphics5::VertexBuffer _buffer; 18 | int _currentIndex; 19 | const int _multiple; 20 | u64 _lastFrameNumber; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/PipelineState5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class ConstantLocation; 6 | class PipelineState; 7 | } 8 | 9 | namespace Graphics5 { 10 | class PipelineState; 11 | class Shader; 12 | } 13 | 14 | class PipelineState5Impl { 15 | public: 16 | PipelineState5Impl(); 17 | Graphics4::PipelineState* state; 18 | }; 19 | 20 | class ConstantLocation5Impl { 21 | public: 22 | Graphics4::ConstantLocation* location; 23 | }; 24 | 25 | class AttributeLocation5Impl {}; 26 | } 27 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Util/Shaders/Blt_ps_ms2.hlsl: -------------------------------------------------------------------------------- 1 | Texture2DMS Input; 2 | sampler Sampler; 3 | 4 | float4 main(float4 pos : SV_POSITION, 5 | float2 tex : TEXCOORD) : SV_TARGET 6 | { 7 | uint width, height, sampleCount; 8 | Input.GetDimensions(width, height, sampleCount); 9 | int2 coord = int2(width * tex.x, height * tex.y); 10 | 11 | // This is a terrible resolve and shouldn't be used for anything 12 | // where we care to maintain the result 13 | return Input.Load(coord, sampleCount / 2); 14 | } -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Util/Shaders/Blt_ps_ms4.hlsl: -------------------------------------------------------------------------------- 1 | Texture2DMS Input; 2 | sampler Sampler; 3 | 4 | float4 main(float4 pos : SV_POSITION, 5 | float2 tex : TEXCOORD) : SV_TARGET 6 | { 7 | uint width, height, sampleCount; 8 | Input.GetDimensions(width, height, sampleCount); 9 | int2 coord = int2(width * tex.x, height * tex.y); 10 | 11 | // This is a terrible resolve and shouldn't be used for anything 12 | // where we care to maintain the result 13 | return Input.Load(coord, sampleCount / 2); 14 | } -------------------------------------------------------------------------------- /Sources/Kore/Network/Socket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Socket { 5 | public: 6 | Socket(); 7 | ~Socket(); 8 | void init(); 9 | void open(int port); 10 | 11 | unsigned urlToInt(const char* url, int port); 12 | void send(unsigned address, int port, const unsigned char* data, int size); 13 | void send(const char* url, int port, const unsigned char* data, int size); 14 | int receive(unsigned char* data, int maxSize, unsigned& fromAddress, unsigned& fromPort); 15 | 16 | private: 17 | int handle; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/PipelineStateImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Kore { 8 | namespace Graphics4 { 9 | class Shader; 10 | } 11 | 12 | class PipelineStateImpl { 13 | public: 14 | PipelineStateImpl(); 15 | 16 | Graphics5::PipelineState* _pipeline; 17 | }; 18 | 19 | class ConstantLocationImpl { 20 | public: 21 | Graphics5::ConstantLocation _location; 22 | }; 23 | 24 | class AttributeLocationImpl {}; 25 | } 26 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/Tracing/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM 3 | REM build.cmd - rebuild generated ETW tracing files from LibOVREvents.man 4 | REM 5 | 6 | REM assume mc.exe is in a path relative to xperf.exe 7 | for /f "delims=" %%a in ('where /F Xperf') do set XPERF_PATH=%%~dpa 8 | 9 | set OSTYPE=x86 10 | if not "%PROCESSOR_ARCHITECTURE%"=="x86" set OSTYPE=x64 11 | if not "%PROCESSOR_ARCHITEW6432%"=="" set OSTYPE=x64 12 | 13 | set MC="%XPERF_PATH%..\bin\%OSTYPE%\mc.exe" 14 | 15 | %MC% -v -a -A -n -um .\LibOVREvents.man -h . -z LibOVREvents 16 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | class RenderTargetImpl { 7 | public: 8 | RenderTargetImpl(int width, int height, int depthBufferBits, bool antialiasing, Graphics5::RenderTargetFormat format, int stencilBufferBits, 9 | int contextId); 10 | RenderTargetImpl(int cubeMapSize, int depthBufferBits, bool antialiasing, Graphics5::RenderTargetFormat format, int stencilBufferBits, int contextId); 11 | Graphics5::RenderTarget _renderTarget; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/OGLTemplateFrame.h: -------------------------------------------------------------------------------- 1 | #ifndef _OGLTEMPLATEFRAME_H_ 2 | #define _OGLTEMPLATEFRAME_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class OGLTemplateFrame : public Tizen::Ui::Controls::Frame { 13 | public: 14 | OGLTemplateFrame(void); 15 | virtual ~OGLTemplateFrame(void); 16 | 17 | public: 18 | virtual result OnInitializing(void); 19 | virtual result OnTerminating(void); 20 | }; 21 | 22 | #endif //_OGLTEMPLATEFRAME_H_ 23 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | struct ShaderRegister { 8 | u8 regtype; 9 | u8 regindex; 10 | u8 regcount; 11 | }; 12 | 13 | class ConstantLocationImpl { 14 | public: 15 | ShaderRegister reg; 16 | int shaderType; // 0: Vertex, 1: Fragment 17 | }; 18 | 19 | class AttributeLocationImpl {}; 20 | 21 | class ShaderImpl { 22 | public: 23 | std::map constants; 24 | std::map attributes; 25 | void* shader; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D11Texture2D; 4 | struct ID3D11ShaderResourceView; 5 | struct ID3D11UnorderedAccessView; 6 | 7 | namespace Kore { 8 | class TextureUnitImpl { 9 | public: 10 | int unit; 11 | bool vertex; 12 | }; 13 | 14 | class TextureImpl { 15 | public: 16 | ~TextureImpl(); 17 | void unmipmap(); 18 | void unset(); 19 | 20 | bool mipmap; 21 | int stage; 22 | ID3D11Texture2D* texture; 23 | ID3D11ShaderResourceView* view; 24 | ID3D11UnorderedAccessView* computeView; 25 | int rowPitch; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Thread.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | Kore::Thread* Kore::createAndRunThread(void (*thread)(void* param), void* param) { 11 | return nullptr; 12 | } 13 | 14 | void Kore::waitForThreadStopThenFree(Thread* sr) {} 15 | 16 | bool Kore::isThreadStoppedThenFree(Thread* sr) { 17 | return false; 18 | } 19 | 20 | void Kore::threadsInit() {} 21 | 22 | void Kore::threadsQuit() {} 23 | 24 | void ThreadYield() {} 25 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/ShaderImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | ShaderImpl::ShaderImpl(void* _data, int length, Graphics5::ShaderType type) : _shader(_data, length, type) {} 9 | 10 | Graphics4::Shader::Shader(void* _data, int length, ShaderType type) : ShaderImpl(_data, length, (Graphics5::ShaderType)type) { 11 | setId(); 12 | } 13 | 14 | Graphics4::Shader::Shader(const char* source, Graphics4::ShaderType type) : ShaderImpl(nullptr, 0, (Graphics5::ShaderType)type) { 15 | setId(); 16 | } 17 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/Shader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Texture.h" 4 | #include "VertexStructure.h" 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Kore { 10 | namespace Graphics5 { 11 | enum ShaderType { FragmentShader, VertexShader, GeometryShader, TessellationControlShader, TessellationEvaluationShader }; 12 | 13 | class Shader : public Shader5Impl { 14 | public: 15 | Shader(void* source, int length, ShaderType type); 16 | }; 17 | 18 | class ConstantLocation : public ConstantLocation5Impl {}; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /updates.md: -------------------------------------------------------------------------------- 1 | * 2017-02-10: createProject and addSubProject were replaced by the simpler addProject. New code looks like this: 2 | 3 | ``` 4 | let project = new Project('Cool Name'); 5 | await project.addProject('aCoolLib'); 6 | resolve(project); 7 | ``` 8 | 9 | addProject is asynchronous, please do not forget to await it. 10 | 11 | Kore itself is now added automatically so if you used createProject to add Kore, just remove it. 12 | 13 | * 2017-04-02: What was previously Kore::Mixer and Kore::Audio is now Kore::Audio1 and Kore::Audio2. 14 | * 2017-03-30: What was previously Kore::Graphics is now Kore::Graphics4. -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/RenderTargetImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D11Texture2D; 4 | struct ID3D11RenderTargetView; 5 | struct ID3D11DepthStencilView; 6 | struct ID3D11ShaderResourceView; 7 | 8 | namespace Kore { 9 | class RenderTargetImpl { 10 | public: 11 | ID3D11Texture2D* texture; 12 | ID3D11RenderTargetView* renderTargetView[6]; 13 | ID3D11Texture2D* depthStencil; 14 | ID3D11DepthStencilView* depthStencilView[6]; 15 | ID3D11ShaderResourceView* renderTargetSRV; 16 | ID3D11ShaderResourceView* depthStencilSRV; 17 | int lastBoundUnit; 18 | int lastBoundDepthUnit; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/ComputeImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class ComputeConstantLocationImpl { 5 | public: 6 | int location; 7 | unsigned int type; 8 | }; 9 | 10 | class ComputeTextureUnitImpl { 11 | public: 12 | int unit; 13 | }; 14 | 15 | class ComputeShaderImpl { 16 | public: 17 | ComputeShaderImpl(void* source, int length); 18 | virtual ~ComputeShaderImpl(); 19 | int findTexture(const char* name); 20 | char** textures; 21 | int* textureValues; 22 | int textureCount; 23 | uint _id; 24 | uint _programid; 25 | char* _source; 26 | int _length; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/Texture5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12Resource; 4 | struct ID3D12DescriptorHeap; 5 | struct ID3D12GraphicsCommandList; 6 | 7 | namespace Kore { 8 | class TextureUnit5Impl { 9 | public: 10 | int unit; 11 | }; 12 | 13 | class Texture5Impl { 14 | public: 15 | ~Texture5Impl(); 16 | void unmipmap(); 17 | void unset(); 18 | 19 | bool mipmap; 20 | int stage; 21 | 22 | ID3D12Resource* image; 23 | ID3D12Resource* uploadImage; 24 | ID3D12DescriptorHeap* srvDescriptorHeap; 25 | static void setTextures(ID3D12GraphicsCommandList* commandList); 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Surface.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Surface.h" 4 | 5 | using namespace Kore; 6 | 7 | namespace { 8 | Surface surface; 9 | } 10 | 11 | Surface* Surface::the() { 12 | return &surface; 13 | } 14 | 15 | void Surface::_move(int index, int x, int y) { 16 | if (Move != nullptr) { 17 | Move(index, x, y); 18 | } 19 | } 20 | 21 | void Surface::_touchStart(int index, int x, int y) { 22 | if (TouchStart != nullptr) { 23 | TouchStart(index, x, y); 24 | } 25 | } 26 | 27 | void Surface::_touchEnd(int index, int x, int y) { 28 | if (TouchEnd != nullptr) { 29 | TouchEnd(index, x, y); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/OGLTemplateFrame.cpp: -------------------------------------------------------------------------------- 1 | #include "OGLTemplateFrame.h" 2 | 3 | using namespace Tizen::Base; 4 | using namespace Tizen::Ui; 5 | using namespace Tizen::Ui::Controls; 6 | 7 | OGLTemplateFrame::OGLTemplateFrame(void) {} 8 | 9 | OGLTemplateFrame::~OGLTemplateFrame(void) {} 10 | 11 | result OGLTemplateFrame::OnInitializing(void) { 12 | result r = E_SUCCESS; 13 | 14 | // TODO: Add your initialization code here 15 | 16 | return r; 17 | } 18 | 19 | result OGLTemplateFrame::OnTerminating(void) { 20 | result r = E_SUCCESS; 21 | 22 | // TODO: Add your termination code here 23 | 24 | return r; 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class PipelineState; 6 | } 7 | 8 | class PipelineStateImpl; 9 | 10 | class ShaderImpl { 11 | public: 12 | ShaderImpl(void* data, int length); 13 | ShaderImpl(const char* source); 14 | virtual ~ShaderImpl(); 15 | uint _glid; 16 | const char* source; 17 | int length; 18 | friend class Graphics4::PipelineState; 19 | friend class PipelineStateImpl; 20 | }; 21 | 22 | class ConstantLocationImpl { 23 | public: 24 | int location; 25 | unsigned int type; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/README.md: -------------------------------------------------------------------------------- 1 | OpenVR SDK 2 | --- 3 | 4 | OpenVR is an API and runtime that allows access to VR hardware from multiple 5 | vendors without requiring that applications have specific knowledge of the 6 | hardware they are targeting. This repository is an SDK that contains the API 7 | and samples. The runtime is under SteamVR in Tools on Steam. 8 | 9 | ### Documentation 10 | 11 | Documentation for the API is available on the [Github Wiki](https://github.com/ValveSoftware/openvr/wiki/API-Documentation) 12 | 13 | More information on OpenVR and SteamVR can be found on http://steamvr.com 14 | -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/Display_XRandr.cpp: -------------------------------------------------------------------------------- 1 | #if defined(KORE_LINUX_SYSTEM_SCREENS_XRANDR) 2 | 3 | #include "pch.h" 4 | #include 5 | 6 | #include 7 | 8 | namespace Kore { 9 | namespace System { 10 | namespace Monitor { 11 | 12 | void enumDisplayMonitors(Screen screens[], int& screenCounter) { 13 | Display* dpy = XOpenDisplay(NULL); 14 | 15 | if (dpy == NULL) { 16 | fatalError("could not open display"); 17 | } 18 | 19 | int major; 20 | int minor; 21 | 22 | if (XRRQueryVersion(dpy, major, minor())) { 23 | } 24 | } 25 | } 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/Tools/OculusVRCValidator/oculus-vrcvalidator.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "827064807402789", 3 | "canonicalName": "oculus-vrcvalidator", 4 | "isCore": true, 5 | "packageType": "CORE_APP", 6 | "launchFile": "OculusVrcValidator.exe", 7 | "launchParameters": "", 8 | "launchFile2D": null, 9 | "launchParameters2D": "", 10 | "version": "1.0", 11 | "versionCode": 100, 12 | "redistributables": [], 13 | "files": { 14 | "OculusVrcValidator.exe": "03dc1bb3227d5da519a43b625a15ad2164e0a9598e3c33f60f2fda7ee066dd1f" 15 | }, 16 | "firewallExceptionsRequired": false 17 | } -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D9/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef KORE_WINDOWS 4 | struct IDirect3DVertexBuffer9; 5 | struct IDirect3DVertexDeclaration9; 6 | #endif 7 | 8 | namespace Kore { 9 | namespace Graphics4 { 10 | class VertexBuffer; 11 | } 12 | 13 | class VertexBufferImpl { 14 | protected: 15 | #ifdef KORE_WINDOWS 16 | IDirect3DVertexBuffer9* vb; 17 | #endif 18 | int myCount; 19 | int myStride; 20 | int instanceDataStepRate; 21 | VertexBufferImpl(int count, int instanceDataStepRate); 22 | void unset(); 23 | 24 | public: 25 | static Graphics4::VertexBuffer* _current; 26 | int _offset; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/IndexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12Resource; 4 | 5 | struct D3D12IindexBufferView { 6 | __int64 BufferLocation; 7 | unsigned int SizeInBytes; 8 | int Format; 9 | }; 10 | 11 | namespace Kore { 12 | class IndexBuffer5Impl { 13 | protected: 14 | IndexBuffer5Impl(int count, bool gpuMemory); 15 | 16 | public: 17 | ID3D12Resource* indexBuffer; 18 | D3D12IindexBufferView indexBufferView; 19 | ID3D12Resource* uploadBuffer; 20 | int myCount; 21 | static IndexBuffer5Impl* _current; 22 | void _upload(ID3D12GraphicsCommandList* commandList); 23 | bool _gpuMemory; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/VertexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12Resource; 4 | 5 | struct D3D12VertexBufferView { 6 | __int64 BufferLocation; 7 | unsigned int SizeInBytes; 8 | unsigned int StrideInBytes; 9 | }; 10 | 11 | namespace Kore { 12 | class VertexBuffer5Impl { 13 | protected: 14 | VertexBuffer5Impl(int count); 15 | 16 | public: 17 | // ID3D12Resource* vertexBuffer; 18 | ID3D12Resource* uploadBuffer; 19 | D3D12VertexBufferView view; 20 | 21 | int myCount; 22 | int myStride; 23 | int lastStart; 24 | int lastCount; 25 | // float* vertices; 26 | static VertexBuffer5Impl* _current; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/ComputeImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | class ComputeConstantLocationImpl {}; 8 | 9 | class ComputeTextureUnitImpl {}; 10 | 11 | struct ComputeShaderConstant { 12 | u32 offset; 13 | u32 size; 14 | u8 columns; 15 | u8 rows; 16 | }; 17 | 18 | class ComputeShaderImpl { 19 | public: 20 | ComputeShaderImpl(); 21 | std::map constants; 22 | int constantsSize; 23 | std::map attributes; 24 | std::map textures; 25 | void* shader; 26 | u8* data; 27 | int length; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/RenderTarget5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef min 6 | #undef min 7 | #endif 8 | 9 | #ifdef max 10 | #undef max 11 | #endif 12 | 13 | #ifdef RegisterClass 14 | #undef RegisterClass 15 | #endif 16 | 17 | namespace Kore { 18 | class RenderTarget5Impl { 19 | public: 20 | VkImage destImage; 21 | VkDeviceMemory destMemory; 22 | VkImageView destView; 23 | 24 | VkImage sourceImage; 25 | VkDeviceMemory sourceMemory; 26 | VkImageView sourceView; 27 | 28 | VkFramebuffer framebuffer; 29 | VkDescriptorSet desc_set; 30 | VkSampler sampler; 31 | VkRenderPass renderPass; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/ConstantBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef min 6 | #undef min 7 | #endif 8 | 9 | #ifdef max 10 | #undef max 11 | #endif 12 | 13 | #ifdef RegisterClass 14 | #undef RegisterClass 15 | #endif 16 | 17 | namespace Kore { 18 | class ConstantBuffer5Impl { 19 | public: 20 | float data[256]; 21 | VkBuffer buf; 22 | VkDescriptorBufferInfo buffer_info; 23 | VkMemoryAllocateInfo mem_alloc; 24 | VkDeviceMemory mem; 25 | 26 | protected: 27 | int lastStart; 28 | int lastCount; 29 | int mySize; 30 | const bool transposeMat3 = false; 31 | const bool transposeMat4 = false; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/Shader5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | Shader5Impl::Shader5Impl(void* source, int length) : length(length), id(0) { 10 | this->source = new char[length + 1]; 11 | for (int i = 0; i < length; ++i) { 12 | this->source[i] = ((char*)source)[i]; 13 | } 14 | this->source[length] = 0; 15 | } 16 | 17 | Shader5Impl::~Shader5Impl() { 18 | delete[] source; 19 | source = nullptr; 20 | } 21 | 22 | Graphics5::Shader::Shader(void* source, int length, ShaderType type) : Shader5Impl(source, length) {} 23 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Keyboard.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Keyboard.h" 4 | 5 | using namespace Kore; 6 | 7 | namespace { 8 | Keyboard keyboard; 9 | } 10 | 11 | Keyboard* Keyboard::the() { 12 | return &keyboard; 13 | } 14 | 15 | void Keyboard::clear() { 16 | KeyDown = nullptr; 17 | KeyUp = nullptr; 18 | KeyPress = nullptr; 19 | } 20 | 21 | void Keyboard::_keydown(KeyCode code) { 22 | if (KeyDown != nullptr) KeyDown(code); 23 | } 24 | 25 | void Keyboard::_keyup(KeyCode code) { 26 | if (KeyUp != nullptr) KeyUp(code); 27 | } 28 | 29 | void Keyboard::_keypress(wchar_t character) { 30 | if (KeyPress != nullptr) KeyPress(character); 31 | } 32 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/TextureImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | typedef Graphics1::Image Image; 8 | 9 | class TextureUnitImpl { 10 | public: 11 | Kore::Graphics5::TextureUnit _unit; 12 | }; 13 | 14 | class TextureImpl { 15 | public: 16 | TextureImpl(); 17 | TextureImpl(int width, int height, Image::Format format, bool readable); 18 | TextureImpl(int width, int height, int depth, Image::Format format, bool readable); 19 | ~TextureImpl(); 20 | void unmipmap(); 21 | void unset(); 22 | 23 | Kore::Graphics5::Texture* _texture; 24 | bool _uploaded; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class CTextureRenderer; 5 | 6 | namespace Kore { 7 | class VideoSoundStream; 8 | 9 | class Video { 10 | public: 11 | Video(const char* filename); 12 | ~Video() { 13 | // delete image; 14 | } 15 | void play(); 16 | void pause(); 17 | void stop(); 18 | int width(); 19 | int height(); 20 | Graphics4::Texture* currentImage(); 21 | double duration; 22 | double position; 23 | bool finished; 24 | bool paused; 25 | void update(double time); 26 | 27 | private: 28 | // Graphics4::Texture* image; 29 | CTextureRenderer* renderer; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/VrInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | enum TrackingOrigin { Stand, Sit }; 7 | 8 | namespace Kore { 9 | namespace VrInterface { 10 | void* init(void* hinst, const char* title, const char* windowClassName); 11 | void begin(); 12 | void beginRender(int eye); 13 | void endRender(int eye); 14 | SensorState getSensorState(int eye); 15 | VrPoseState getController(int index); 16 | void warpSwap(); 17 | 18 | void updateTrackingOrigin(TrackingOrigin origin); 19 | void resetHmdPose(); 20 | void ovrShutdown(); 21 | 22 | // AR device functions 23 | CameraImage* getCurrentCameraImage(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/IndexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef min 6 | #undef min 7 | #endif 8 | 9 | #ifdef max 10 | #undef max 11 | #endif 12 | 13 | #ifdef RegisterClass 14 | #undef RegisterClass 15 | #endif 16 | 17 | namespace Kore { 18 | namespace Graphics5 { 19 | class IndexBuffer; 20 | } 21 | 22 | class IndexBuffer5Impl { 23 | protected: 24 | public: 25 | IndexBuffer5Impl(int count); 26 | void unset(); 27 | 28 | int* data; 29 | int myCount; 30 | uint bufferId; 31 | 32 | VkBuffer buf; 33 | VkDeviceMemory mem; 34 | VkMemoryAllocateInfo mem_alloc; 35 | 36 | public: 37 | static Graphics5::IndexBuffer* current; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/ProgramImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics4 { 5 | class Shader; 6 | } 7 | 8 | class ProgramImpl { 9 | protected: 10 | uint programId; 11 | Graphics4::Shader* vertexShader; 12 | Graphics4::Shader* fragmentShader; 13 | Graphics4::Shader* geometryShader; 14 | Graphics4::Shader* tessellationControlShader; 15 | Graphics4::Shader* tessellationEvaluationShader; 16 | 17 | ProgramImpl(); 18 | virtual ~ProgramImpl(); 19 | int findTexture(const char* name); 20 | const char** textures; 21 | int* textureValues; 22 | int textureCount; 23 | }; 24 | 25 | class ConstantLocationImpl { 26 | public: 27 | int location; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | struct DeviceInfo { 6 | int number; 7 | bool isAvailable; 8 | char name[32]; 9 | int x; 10 | int y; 11 | int width; 12 | int height; 13 | bool isPrimary; 14 | 15 | DeviceInfo() { 16 | number = -1; 17 | name[0] = 0; 18 | isAvailable = false; 19 | isPrimary = false; 20 | } 21 | }; 22 | 23 | void enumerate(); 24 | const DeviceInfo* primaryScreen(); 25 | const DeviceInfo* screenById(int id); 26 | int height(int index); 27 | int width(int index); 28 | int x(int index); 29 | int y(int index); 30 | bool isPrimary(int index); 31 | int count(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Backends/System/Pi/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Display { 5 | struct DeviceInfo { 6 | int number; 7 | bool isAvailable; 8 | char name[32]; 9 | int x; 10 | int y; 11 | int width; 12 | int height; 13 | bool isPrimary; 14 | 15 | DeviceInfo() { 16 | number = -1; 17 | name[0] = 0; 18 | isAvailable = false; 19 | isPrimary = false; 20 | } 21 | }; 22 | 23 | void enumerate(); 24 | const DeviceInfo* primaryScreen(); 25 | const DeviceInfo* screenById(int id); 26 | 27 | int height(int index); 28 | int width(int index); 29 | int x(int index); 30 | int y(int index); 31 | bool isPrimary(int index); 32 | int count(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/ShaderImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "ogl.h" 2 | #include "pch.h" 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | ShaderImpl::ShaderImpl(void* source, int length) : length(length), id(0) { 10 | this->source = new char[length + 1]; 11 | for (int i = 0; i < length; ++i) { 12 | this->source[i] = ((char*)source)[i]; 13 | } 14 | this->source[length] = 0; 15 | } 16 | 17 | ShaderImpl::~ShaderImpl() { 18 | delete[] source; 19 | source = nullptr; 20 | if (id != 0) glDeleteShader(id); 21 | } 22 | 23 | Graphics4::Shader::Shader(void* source, int length, Graphics4::ShaderType type) : ShaderImpl(source, length) {} 24 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/ConstantBuffer5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | ConstantBuffer5Impl::ConstantBuffer5Impl() : transposeMat3(false), transposeMat4(false) {} 8 | 9 | Graphics5::ConstantBuffer::ConstantBuffer(int size) { 10 | mySize = size; 11 | data = nullptr; 12 | } 13 | 14 | Graphics5::ConstantBuffer::~ConstantBuffer() {} 15 | 16 | void Graphics5::ConstantBuffer::lock() { 17 | lock(0, size()); 18 | } 19 | 20 | void Graphics5::ConstantBuffer::lock(int start, int count) {} 21 | 22 | void Graphics5::ConstantBuffer::unlock() { 23 | 24 | data = nullptr; 25 | } 26 | 27 | int Graphics5::ConstantBuffer::size() { 28 | return mySize; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/Direct3D11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #ifdef KORE_WINDOWSAPP 6 | #include 7 | #else 8 | #pragma warning(disable : 4005) 9 | #include 10 | #endif 11 | 12 | extern ID3D11Device* device; 13 | extern ID3D11DeviceContext* context; 14 | extern ID3D11RenderTargetView* renderTargetView; 15 | extern ID3D11DepthStencilView* depthStencilView; 16 | extern ID3D11Texture2D* backBuffer; 17 | extern Kore::u8 vertexConstants[1024 * 4]; 18 | extern Kore::u8 fragmentConstants[1024 * 4]; 19 | extern Kore::u8 geometryConstants[1024 * 4]; 20 | extern Kore::u8 tessControlConstants[1024 * 4]; 21 | extern Kore::u8 tessEvalConstants[1024 * 4]; 22 | -------------------------------------------------------------------------------- /Sources/Kore/Audio1/SoundStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct stb_vorbis; 4 | 5 | namespace Kore { 6 | class SoundStream { 7 | public: 8 | SoundStream(const char* filename, bool looping); 9 | float nextSample(); 10 | int channels(); 11 | int sampleRate(); 12 | bool looping(); 13 | void setLooping(bool loop); 14 | bool ended(); 15 | float length(); 16 | float position(); 17 | void reset(); 18 | float volume(); 19 | void setVolume(float value); 20 | 21 | private: 22 | stb_vorbis* vorbis; 23 | int chans; 24 | int rate; 25 | bool myLooping; 26 | float myVolume; 27 | bool decoded; 28 | bool rateDecodedHack; 29 | bool end; 30 | float samples[2]; 31 | u8* buffer; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Pen.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Pen.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | namespace { 11 | Pen pen; 12 | } 13 | 14 | Pen* Pen::the() { 15 | return &pen; 16 | } 17 | 18 | Pen::Pen() {} 19 | 20 | void Pen::_move(int windowId, int x, int y, float pressure) { 21 | if (Move != nullptr) { 22 | Move(windowId, x, y, pressure); 23 | } 24 | } 25 | 26 | void Pen::_press(int windowId, int x, int y, float pressure) { 27 | if (Press != nullptr) { 28 | Press(windowId, x, y, pressure); 29 | } 30 | } 31 | 32 | void Pen::_release(int windowId, int x, int y, float pressure) { 33 | if (Release != nullptr) { 34 | Release(windowId, x, y, pressure); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/Conversion.winrt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include 4 | 5 | using namespace Windows::Foundation::Numerics; 6 | 7 | inline Kore::mat4 WindowsNumericsToKoreMat(float4x4 m) { 8 | Kore::mat4 mat; 9 | mat.Set(0, 0, m.m11); 10 | mat.Set(0, 1, m.m21); 11 | mat.Set(0, 2, m.m31); 12 | mat.Set(0, 3, m.m41); 13 | 14 | mat.Set(1, 0, m.m12); 15 | mat.Set(1, 1, m.m22); 16 | mat.Set(1, 2, m.m32); 17 | mat.Set(1, 3, m.m42); 18 | 19 | mat.Set(2, 0, m.m13); 20 | mat.Set(2, 1, m.m23); 21 | mat.Set(2, 2, m.m33); 22 | mat.Set(2, 3, m.m43); 23 | 24 | mat.Set(3, 0, m.m14); 25 | mat.Set(3, 1, m.m24); 26 | mat.Set(3, 2, m.m34); 27 | mat.Set(3, 3, m.m44); 28 | return mat; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics4 { 7 | class VertexBuffer; 8 | } 9 | 10 | class VertexBufferImpl { 11 | protected: 12 | VertexBufferImpl(int count, int instanceDataStepRate); 13 | void unset(); 14 | float* data; 15 | int myCount; 16 | int myStride; 17 | uint bufferId; 18 | //#if defined KORE_ANDROID || defined KORE_HTML5 || defined KORE_TIZEN 19 | Graphics4::VertexStructure structure; 20 | //#endif 21 | int instanceDataStepRate; 22 | int setVertexAttributes(int offset); 23 | #ifndef NDEBUG 24 | bool initialized; 25 | #endif 26 | public: 27 | static Graphics4::VertexBuffer* current; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/VertexBufferImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Graphics3 { 7 | class VertexBuffer; 8 | } 9 | 10 | class VertexBufferImpl { 11 | protected: 12 | VertexBufferImpl(int count, int instanceDataStepRate); 13 | void unset(); 14 | float* data; 15 | int myCount; 16 | int myStride; 17 | uint bufferId; 18 | //#if defined KORE_ANDROID || defined KORE_HTML5 || defined KORE_TIZEN 19 | Graphics4::VertexStructure structure; 20 | //#endif 21 | int instanceDataStepRate; 22 | int setVertexAttributes(int offset); 23 | #ifndef NDEBUG 24 | bool initialized; 25 | #endif 26 | public: 27 | static Graphics3::VertexBuffer* current; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /Backends/System/POSIX/Sources/Kore/Mutex.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include 3 | 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | void Mutex::create() { 9 | pthread_mutex_init(&pthread_mutex, nullptr); 10 | } 11 | 12 | void Mutex::destroy() { 13 | pthread_mutex_destroy(&pthread_mutex); 14 | } 15 | 16 | void Mutex::lock() { 17 | pthread_mutex_lock(&pthread_mutex); 18 | } 19 | 20 | void Mutex::unlock() { 21 | pthread_mutex_unlock(&pthread_mutex); 22 | } 23 | 24 | bool UberMutex::create(const wchar_t* name) { 25 | return false; 26 | } 27 | 28 | void UberMutex::destroy() {} 29 | 30 | void UberMutex::lock() { 31 | // affirm(false); 32 | } 33 | 34 | void UberMutex::unlock() { 35 | // affirm(false); 36 | } 37 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct HMONITOR__; 4 | typedef HMONITOR__* HMONITOR; 5 | 6 | namespace Kore { 7 | namespace Display { 8 | struct DeviceInfo { 9 | HMONITOR id; 10 | bool isAvailable; 11 | char name[32]; 12 | int x; 13 | int y; 14 | int width; 15 | int height; 16 | bool isPrimary; 17 | 18 | DeviceInfo() { 19 | id = nullptr; 20 | name[0] = 0; 21 | isAvailable = false; 22 | isPrimary = false; 23 | } 24 | }; 25 | 26 | void enumerate(); 27 | const DeviceInfo* primary(); 28 | const DeviceInfo* byId(int id); 29 | int height(int index); 30 | int width(int index); 31 | int x(int index); 32 | int y(int index); 33 | bool isPrimary(int index); 34 | int count(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/CameraImage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class CameraImage { 7 | public: 8 | CameraImage(int imageHeight, int imageWidth, int* imageBGRA8Data, Kore::mat4 cameraViewTransform, Kore::mat4 cameraProjectionTransform, 9 | Kore::vec2 focalLength); 10 | ~CameraImage(); 11 | int* imageBGRA8Data; 12 | int imageHeight, imageWidth; 13 | 14 | // in world (root) coordinate system 15 | Kore::mat4 cameraViewTransform; 16 | Kore::mat4 cameraProjectionTransform; 17 | Kore::vec2 focalLength; 18 | 19 | void getWorldRayForPixelPosition(Kore::vec2 pixelPosition, Kore::vec3& origin, Kore::vec3& direction); // origin at camera pos 20 | Kore::vec2 getPixelForWorldPosition(Kore::vec3 worldPos); 21 | }; 22 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/Mutex.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | //#include 3 | 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | void Mutex::create() { 9 | // pthread_mutex_init(&pthread_mutex, nullptr); 10 | } 11 | 12 | void Mutex::destroy() { 13 | // pthread_mutex_destroy(&pthread_mutex); 14 | } 15 | 16 | void Mutex::lock() { 17 | // pthread_mutex_lock(&pthread_mutex); 18 | } 19 | 20 | void Mutex::unlock() { 21 | // pthread_mutex_unlock(&pthread_mutex); 22 | } 23 | 24 | bool UberMutex::create(const wchar_t* name) { 25 | return false; 26 | } 27 | 28 | void UberMutex::destroy() {} 29 | 30 | void UberMutex::lock() { 31 | // affirm(false); 32 | } 33 | 34 | void UberMutex::unlock() { 35 | // affirm(false); 36 | } 37 | -------------------------------------------------------------------------------- /Sources/Kore/Input/Sensor.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Sensor.h" 4 | 5 | using namespace Kore; 6 | 7 | namespace { 8 | Sensor accelerometer; 9 | Sensor gyroscope; 10 | } 11 | 12 | Sensor* Sensor::the(SensorType type) { 13 | switch (type) { 14 | case SensorAccelerometer: 15 | return &accelerometer; 16 | case SensorGyroscope: 17 | return &gyroscope; 18 | default: 19 | return nullptr; 20 | } 21 | } 22 | 23 | void Sensor::_changed(SensorType type, float x, float y, float z) { 24 | switch (type) { 25 | case SensorAccelerometer: 26 | if (accelerometer.Changed != nullptr) { 27 | accelerometer.Changed(x, y, z); 28 | } 29 | break; 30 | case SensorGyroscope: 31 | if (gyroscope.Changed != nullptr) { 32 | gyroscope.Changed(x, y, z); 33 | } 34 | break; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/RenderTargetImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "RenderTargetImpl.h" 4 | 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | RenderTarget::RenderTarget(int width, int height, int depthBufferBits, bool antialiasing, RenderTargetFormat format, int stencilBufferBits, int contextId) 10 | : width(width), height(height), texWidth(width), texHeight(height) {} 11 | 12 | RenderTarget::RenderTarget(int cubeMapSize, int depthBufferBits, bool antialiasing, RenderTargetFormat format, int stencilBufferBits, int contextId) {} 13 | 14 | RenderTarget::~RenderTarget() {} 15 | 16 | void RenderTarget::useColorAsTexture(TextureUnit unit) {} 17 | 18 | void RenderTarget::setDepthStencilFrom(RenderTarget* source) {} 19 | 20 | void RenderTarget::useDepthAsTexture(TextureUnit unit) {} 21 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/OculusSDK/LibOVRKernel/Src/GL/BUCK_WIN: -------------------------------------------------------------------------------- 1 | include_defs('//LibOVRKernel/DEFS', 'libovrkernel') 2 | 3 | cxx_library( 4 | name = 'headers', 5 | header_namespace = 'GL', 6 | exported_headers = glob(['*.h']), 7 | visibility = ['PUBLIC'], 8 | ) 9 | 10 | cxx_library( 11 | name = 'GL', 12 | header_namespace = 'GL', 13 | srcs=['CAPI_GLE.cpp'], 14 | headers = glob(['*.h']), 15 | exported_headers = { 16 | 'GL/CAPI_GLE.h' : 'CAPI_GLE.h', 17 | 'GL/CAPI_GLE_GL.h' : 'CAPI_GLE_GL.h', 18 | }, 19 | deps = [ 20 | '//LibOVRKernel/Src/Kernel:headers_win', 21 | ], 22 | visibility = ['PUBLIC'], 23 | compiler_flags = WINDOWS_COMPILE_FLAGS + WINDOWS_COMMON_FLAGS + libovrkernel.WINDOWS_COMPILE_FLAGS, 24 | preferred_linkage = 'static', 25 | ) 26 | -------------------------------------------------------------------------------- /Sources/Kore/Audio3/Audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Kore { 6 | namespace Audio3 { 7 | struct BufferFormat { 8 | int channels; 9 | int samplesPerSecond; 10 | int bitsPerSample; 11 | }; 12 | 13 | struct Buffer { 14 | BufferFormat format; 15 | u8* data; 16 | int dataSize; 17 | int readLocation; 18 | int writeLocation; 19 | }; 20 | 21 | typedef void (*AudioCallback)(int samples); 22 | 23 | struct Channel { 24 | vec3 origin; 25 | AudioCallback callback; 26 | Buffer buffer; 27 | bool active; 28 | }; 29 | 30 | void init(); 31 | void update(); 32 | void shutdown(); 33 | 34 | Channel* createChannel(vec3 origin, AudioCallback callback); 35 | void destroyChannel(Channel* channel); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Backends/Graphics5/Metal/Sources/Kore/Shader5Impl.mm: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace Kore; 10 | 11 | id getMetalLibrary(); 12 | 13 | Shader5Impl::Shader5Impl(void* source, int length) { 14 | u8* data = (u8*)source; 15 | for (int i = 0; i < length; ++i) { 16 | name[i] = data[i]; 17 | } 18 | name[length] = 0; 19 | } 20 | 21 | Graphics5::Shader::Shader(void* source, int length, ShaderType type) : Shader5Impl(source, length) { 22 | id library = getMetalLibrary(); 23 | id program; 24 | program = [library newFunctionWithName:[NSString stringWithCString:name encoding:NSUTF8StringEncoding]]; 25 | mtlFunction = program; 26 | } 27 | -------------------------------------------------------------------------------- /Sources/Kore/Vr/VrPoseState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | enum TrackedDevice { HMD, Controller, ViveTracker }; 7 | 8 | class VrPoseState { 9 | public: 10 | VrPoseState(); 11 | ~VrPoseState(); 12 | 13 | VrPose vrPose; 14 | Kore::vec3 angularVelocity; // Angular velocity in radians per second. 15 | Kore::vec3 linearVelocity; // Velocity in meters per second. 16 | Kore::vec3 angularAcceleration; // Angular acceleration in radians per second per second. 17 | Kore::vec3 linearAcceleration; // Acceleration in meters per second per second. 18 | 19 | TrackedDevice trackedDevice; 20 | 21 | // Sensor status 22 | bool isVisible; 23 | bool hmdPresenting; 24 | bool hmdMounted; 25 | bool displayLost; 26 | bool shouldQuit; 27 | bool shouldRecenter; 28 | }; 29 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Display.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Display.h" 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace Kore { 10 | namespace Display { 11 | enum { MAXIMUM_DISPLAY_COUNT = 10 }; 12 | 13 | DeviceInfo displays[10]; 14 | 15 | void enumerate() {} 16 | 17 | int count() { 18 | return 1; 19 | } 20 | 21 | const DeviceInfo* primary() { 22 | return nullptr; 23 | } 24 | 25 | const DeviceInfo* byId(int id) { 26 | return nullptr; 27 | } 28 | 29 | int width(int index) { 30 | return 100; 31 | } 32 | 33 | int height(int index) { 34 | return 100; 35 | } 36 | 37 | int x(int index) { 38 | return 0; 39 | } 40 | 41 | int y(int index) { 42 | return 0; 43 | } 44 | 45 | bool isPrimary(int index) { 46 | return true; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Sources/Kore/Audio1/Audio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Sound.h" 4 | #include "SoundStream.h" 5 | 6 | namespace Kore { 7 | class VideoSoundStream; 8 | 9 | namespace Audio1 { 10 | struct Channel { 11 | Sound* sound; 12 | float position; 13 | bool loop; 14 | float volume; 15 | float pitch; 16 | }; 17 | 18 | struct StreamChannel { 19 | SoundStream* stream; 20 | int position; 21 | }; 22 | 23 | struct VideoChannel { 24 | VideoSoundStream* stream; 25 | int position; 26 | }; 27 | 28 | void init(); 29 | Channel* play(Sound* sound, bool loop = false, float pitch = 1.0f, bool unique = false); 30 | void stop(Sound* sound); 31 | void play(SoundStream* stream); 32 | void stop(SoundStream* stream); 33 | void play(VideoSoundStream* stream); 34 | void stop(VideoSoundStream* stream); 35 | void mix(int samples); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics1/Color.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | namespace Graphics1 { 5 | class Color { 6 | 7 | private: 8 | void getColorFromHex(uint color, float& red, float& green, float& blue, float& alpha); 9 | 10 | public: 11 | Color(uint color); 12 | 13 | float R; 14 | float G; 15 | float B; 16 | float A; 17 | 18 | static const uint Black = 0xff000000; 19 | static const uint White = 0xffffffff; 20 | static const uint Red = 0xffff0000; 21 | static const uint Blue = 0xff0000ff; 22 | static const uint Green = 0xff00ff00; 23 | static const uint Magenta = 0xffff00ff; 24 | static const uint Yellow = 0xffffff00; 25 | static const uint Cyan = 0xff00ffff; 26 | static const uint Purple = 0xff800080; 27 | static const uint Pink = 0xffffc0cb; 28 | static const uint Orange = 0xffffa500; 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/Kode/Kore.svg?branch=master)](https://travis-ci.org/Kode/Kore) [![Build status](https://ci.appveyor.com/api/projects/status/y3yxe87qj32wqcou/branch/master?svg=true)](https://ci.appveyor.com/project/RobDangerous/kore) 2 | 3 | ## Kore 4 | 5 | Kore projects are built using koremake, a nodejs tool. 6 | In your project's directory call `node Kore/make` - this will 7 | create a project file for your IDE in a build subdirectory. 8 | koremake by default creates a project for the system you are currently using, 9 | but you can also put one of windows, linux, android, windowsapp, osx and ios 10 | in the arguments list to create something else. In Windows you can also 11 | choose your graphics api (gfx=direct3d9/direct3d11/direct3d12/opengl/vulkan/metal) 12 | and your Visual Studio version (vs=vs2010/vs2012/vs2013/vs2015/vs2017). 13 | -------------------------------------------------------------------------------- /Backends/Graphics4/G4onG5/Sources/Kore/IndexBufferImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "IndexBufferImpl.h" 4 | 5 | #include 6 | 7 | #include 8 | 9 | using namespace Kore; 10 | 11 | extern Graphics5::CommandList* commandList; 12 | 13 | Kore::IndexBufferImpl::IndexBufferImpl(int count) : _buffer(count, true) {} 14 | 15 | Graphics4::IndexBuffer::IndexBuffer(int count) : IndexBufferImpl(count) {} 16 | 17 | Graphics4::IndexBuffer::~IndexBuffer() {} 18 | 19 | int* Graphics4::IndexBuffer::lock() { 20 | return _buffer.lock(); 21 | } 22 | 23 | void Graphics4::IndexBuffer::unlock() { 24 | _buffer.unlock(); 25 | commandList->upload(&_buffer); 26 | } 27 | 28 | void Graphics4::IndexBuffer::_set() { 29 | _buffer._set(); 30 | } 31 | 32 | int Graphics4::IndexBuffer::count() { 33 | return _buffer.count(); 34 | ; 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics3/Graphics.cpp: -------------------------------------------------------------------------------- 1 | #include "Graphics.h" 2 | #include "pch.h" 3 | #include 4 | 5 | using namespace Kore; 6 | 7 | #ifndef KORE_G4 8 | 9 | namespace { 10 | int samples = 1; 11 | bool window = true; 12 | } 13 | 14 | #if !defined(KORE_WINDOWS) 15 | void Graphics3::Graphics3::setup() {} 16 | #endif 17 | 18 | int Graphics3::antialiasingSamples() { 19 | return ::samples; 20 | } 21 | 22 | void Graphics3::setAntialiasingSamples(int samples) { 23 | ::samples = samples; 24 | } 25 | 26 | bool Graphics3::hasWindow() { 27 | return ::window; 28 | } 29 | 30 | void Graphics3::setWindow(bool value) { 31 | ::window = value; 32 | } 33 | 34 | bool Graphics3::fullscreen = false; 35 | 36 | void Graphics3::setVertexBuffer(VertexBuffer& vertexBuffer) { 37 | VertexBuffer* vertexBuffers[1] = {&vertexBuffer}; 38 | setVertexBuffers(vertexBuffers, 1); 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Backends/System/HTML5/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Texture(100, 100, Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Texture(100, 100, Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Backends/System/Unreal/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Texture(100, 100, Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Mutex.winrt.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | void Mutex::create() { 10 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 11 | InitializeCriticalSection((CRITICAL_SECTION*)&criticalSection); 12 | #endif 13 | } 14 | 15 | void Mutex::destroy() { 16 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 17 | DeleteCriticalSection((CRITICAL_SECTION*)&criticalSection); 18 | #endif 19 | } 20 | 21 | void Mutex::lock() { 22 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 23 | EnterCriticalSection((CRITICAL_SECTION*)&criticalSection); 24 | #endif 25 | } 26 | 27 | void Mutex::unlock() { 28 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 29 | LeaveCriticalSection((CRITICAL_SECTION*)&criticalSection); 30 | #endif 31 | } 32 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/Display.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Kore { 8 | namespace Display { 9 | int count() { 10 | return 1; 11 | } 12 | 13 | int width(int index) { 14 | log(Warning, "TODO (DK) Kore::Display::width(int) implement me"); 15 | return -1; 16 | } 17 | 18 | int height(int index) { 19 | log(Warning, "TODO (DK) Kore::Display::width(int) implement me"); 20 | return -1; 21 | } 22 | 23 | int x(int index) { 24 | log(Warning, "TODO (DK) Kore::Display::x(int) implement me"); 25 | return -1; 26 | } 27 | 28 | int y(int index) { 29 | log(Warning, "TODO (DK) Kore::Display::y(int) implement me"); 30 | return -1; 31 | } 32 | 33 | bool isPrimary(int index) { 34 | log(Warning, "TODO (DK) Kore::Display::isPrimary(int) implement me"); 35 | return -1; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Display.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Kore { 8 | namespace Display { 9 | int count() { 10 | return 1; 11 | } 12 | 13 | int width(int index) { 14 | log(Warning, "TODO (DK) Kore::Display::width(int) implement me"); 15 | return -1; 16 | } 17 | 18 | int height(int index) { 19 | log(Warning, "TODO (DK) Kore::Display::width(int) implement me"); 20 | return -1; 21 | } 22 | 23 | int x(int index) { 24 | log(Warning, "TODO (DK) Kore::Display::x(int) implement me"); 25 | return -1; 26 | } 27 | 28 | int y(int index) { 29 | log(Warning, "TODO (DK) Kore::Display::y(int) implement me"); 30 | return -1; 31 | } 32 | 33 | bool isPrimary(int index) { 34 | log(Warning, "TODO (DK) Kore::Display::isPrimary(int) implement me"); 35 | return -1; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Input/HIDManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "HIDGamepad.h" 8 | 9 | namespace Kore { 10 | class HIDManager { 11 | 12 | private: 13 | IOHIDManagerRef managerRef; 14 | 15 | int initHIDManager(); 16 | 17 | bool addMatchingArray(CFMutableArrayRef matchingCFArrayRef, CFDictionaryRef matchingCFDictRef); 18 | CFMutableDictionaryRef createDeviceMatchingDictionary(u32 inUsagePage, u32 inUsage); 19 | 20 | static void deviceConnected(void* inContext, IOReturn inResult, void* inSender, IOHIDDeviceRef inIOHIDDeviceRef); 21 | static void deviceRemoved(void* inContext, IOReturn inResult, void* inSender, IOHIDDeviceRef inIOHIDDeviceRef); 22 | 23 | public: 24 | HIDManager(); 25 | ~HIDManager(); 26 | 27 | static void cleanupPad(int index); 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/Graphics.cpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENGL_1_X 3 | 4 | #include "pch.h" 5 | 6 | #include "Graphics.h" 7 | 8 | #include 9 | 10 | using namespace Kore; 11 | 12 | namespace { 13 | int samples = 1; 14 | bool window = true; 15 | } 16 | 17 | #if !defined(KORE_WINDOWS) && !defined(KORE_XBOX_ONE) 18 | void Graphics5::setup() {} 19 | #endif 20 | 21 | int Graphics5::antialiasingSamples() { 22 | return ::samples; 23 | } 24 | 25 | void Graphics5::setAntialiasingSamples(int samples) { 26 | ::samples = samples; 27 | } 28 | 29 | bool Graphics5::hasWindow() { 30 | return ::window; 31 | } 32 | 33 | void Graphics5::setWindow(bool value) { 34 | ::window = value; 35 | } 36 | 37 | bool Graphics5::fullscreen = false; 38 | 39 | // void Graphics5::setVertexBuffer(VertexBuffer& vertexBuffer) { 40 | // VertexBuffer* vertexBuffers[1] = {&vertexBuffer}; 41 | // setVertexBuffers(vertexBuffers, 1); 42 | //} 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Backends/System/Pi/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Graphics4::Texture(100, 100, Graphics4::Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Graphics4::Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Graphics4::Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Backends/System/Linux/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Graphics4::Texture(100, 100, Graphics4::Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Graphics4::Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Graphics4::Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Backends/System/WindowsApp/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | public: 9 | Video(const char* filename) { 10 | duration = 1000 * 10; 11 | position = 0; 12 | finished = false; 13 | paused = false; 14 | image = new Graphics4::Texture(100, 100, Graphics1::Image::RGBA32, false); 15 | } 16 | ~Video() { 17 | delete image; 18 | } 19 | void play() {} 20 | void pause() {} 21 | void stop() {} 22 | int width() { 23 | return 100; 24 | } 25 | int height() { 26 | return 100; 27 | } 28 | Graphics4::Texture* currentImage() { 29 | return image; 30 | } 31 | double duration; // milliseconds 32 | double position; // milliseconds 33 | bool finished; 34 | bool paused; 35 | void update(double time) {} 36 | 37 | private: 38 | Graphics4::Texture* image; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/Shader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Texture.h" 4 | #include "VertexStructure.h" 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Kore { 10 | namespace Graphics4 { 11 | enum ShaderType { FragmentShader, VertexShader, GeometryShader, TessellationControlShader, TessellationEvaluationShader }; 12 | 13 | class Shader : public ShaderImpl { 14 | public: 15 | Shader(void* data, int length, ShaderType type); 16 | Shader(const char* source, ShaderType type); // Beware, this is not portable 17 | u32 id; 18 | 19 | private: 20 | void setId() { 21 | static u32 lastId = 0; 22 | id = lastId++; 23 | } 24 | }; 25 | 26 | class ConstantLocation : public ConstantLocationImpl { 27 | public: 28 | u32 id; 29 | 30 | ConstantLocation() { 31 | static u32 lastId = 0; 32 | id = lastId++; 33 | } 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/IndexBuffer5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "IndexBuffer5Impl.h" 4 | 5 | #include 6 | 7 | #include 8 | 9 | using namespace Kore; 10 | 11 | IndexBuffer5Impl* IndexBuffer5Impl::_current = nullptr; 12 | 13 | IndexBuffer5Impl::IndexBuffer5Impl(int count, bool gpuMemory) : myCount(count) { 14 | buffer = new Graphics4::IndexBuffer(count); 15 | } 16 | 17 | Graphics5::IndexBuffer::IndexBuffer(int count, bool gpuMemory) : IndexBuffer5Impl(count, gpuMemory) {} 18 | 19 | Graphics5::IndexBuffer::~IndexBuffer() { 20 | delete buffer; 21 | } 22 | 23 | int* Graphics5::IndexBuffer::lock() { 24 | return buffer->lock(); 25 | } 26 | 27 | void Graphics5::IndexBuffer::unlock() { 28 | buffer->unlock(); 29 | } 30 | 31 | void Graphics5::IndexBuffer::_set() { 32 | _current = this; 33 | } 34 | 35 | int Graphics5::IndexBuffer::count() { 36 | return myCount; 37 | } 38 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 the Kore Development Team 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source distribution. 20 | -------------------------------------------------------------------------------- /Backends/Graphics3/OpenGL1/Sources/Kore/LightImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ogl.h" 4 | #include 5 | 6 | namespace Kore { 7 | enum LightType { DirectionalLight, PointLight, SpotLight }; 8 | 9 | class LightImpl { 10 | public: 11 | LightImpl(); 12 | virtual ~LightImpl(); 13 | 14 | protected: 15 | // Submit light parameters to OpenGL (lightID is GL_LIGHT where is in the range [0, 7]) 16 | void submitLightParamsToGL(GLenum lightID) const; 17 | 18 | // Submit light transformation to OpenGL (lightID is GL_LIGHT where is in the range [0, 7]). 19 | void submitLightTransformToGL(GLenum lightID) const; 20 | 21 | LightType myType; 22 | vec4 myAmbient; 23 | vec4 myDiffuse; 24 | vec4 mySpecular; 25 | vec4 myPositionOrDirection; 26 | vec3 mySpotDirection; 27 | float mySpotExponent; 28 | float mySpotCutoff; 29 | float myConstAttn; 30 | float myLinearAttn; 31 | float myQuadricAttn; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/Texture.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Texture.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | Graphics5::Texture::Texture(Kore::Reader& reader, const char* format, bool readable) : Image(reader, format, readable) { 11 | _init(format, readable); 12 | } 13 | 14 | Graphics5::Texture::Texture(const char* filename, bool readable) { 15 | FileReader reader(filename); 16 | Image::init(reader, filename, readable); 17 | _init(filename, readable); 18 | } 19 | 20 | Graphics5::Texture::Texture(void* data, int size, const char* format, bool readable) { 21 | BufferReader reader(data, size); 22 | Image::init(reader, format, readable); 23 | _init(format, readable); 24 | } 25 | 26 | Graphics5::Texture::Texture(void* data, int width, int height, int format, bool readable) : Image(data, width, height, Image::Format(format), readable) { 27 | _init("", readable); 28 | } 29 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/OGLTemplateEntry.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // This file contains the Tizen application entry point. 3 | // 4 | #include "OGLTemplate.h" 5 | 6 | using namespace Tizen::Base; 7 | using namespace Tizen::Base::Collection; 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif // __cplusplus 12 | 13 | // 14 | // The entry function of Tizen application called by the operating system. 15 | // 16 | _EXPORT_ int OspMain(int argc, char* pArgv[]) { 17 | AppLog("Application started."); 18 | ArrayList args(SingleObjectDeleter); 19 | args.Construct(); 20 | for (int i = 0; i < argc; i++) { 21 | args.Add(new (std::nothrow) String(pArgv[i])); 22 | } 23 | 24 | result r = Tizen::App::UiApp::Execute(OGLTemplateApp::CreateInstance, &args); 25 | TryLog(r == E_SUCCESS, "[%s] Application execution failed", GetErrorMessage(r)); 26 | AppLog("Application finished."); 27 | 28 | return static_cast(r); 29 | } 30 | #ifdef __cplusplus 31 | } 32 | #endif // __cplusplus 33 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/VertexBuffer5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef min 7 | #undef min 8 | #endif 9 | 10 | #ifdef max 11 | #undef max 12 | #endif 13 | 14 | #ifdef RegisterClass 15 | #undef RegisterClass 16 | #endif 17 | 18 | namespace Kore { 19 | struct Vertices { 20 | VkBuffer buf; 21 | VkDeviceMemory mem; 22 | }; 23 | 24 | namespace Graphics5 { 25 | class VertexBuffer; 26 | } 27 | 28 | class VertexBuffer5Impl { 29 | protected: 30 | VertexBuffer5Impl(int count, int instanceDataStepRate); 31 | void unset(); 32 | float* data; 33 | int myCount; 34 | int myStride; 35 | uint bufferId; 36 | Graphics5::VertexStructure structure; 37 | 38 | VkMemoryAllocateInfo mem_alloc; 39 | 40 | int instanceDataStepRate; 41 | int setVertexAttributes(int offset); 42 | 43 | public: 44 | Vertices vertices; 45 | static Graphics5::VertexBuffer* current; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/Motion.mm: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #import "Motion.h" 4 | 5 | @implementation Motion 6 | /* 7 | Motion* the = [[Motion alloc]init]; 8 | + (Motion*) the {return the;}; 9 | 10 | -(void)configureAccelerometerWithGyroHandler: (Kt::GyroHandler*) gyroHandler 11 | AndUpdateInterval: (int) updateInterval 12 | { 13 | UIAccelerometer *accelerometer = [UIAccelerometer sharedAccelerometer]; 14 | accelerometer.updateInterval = 1 / updateInterval; 15 | 16 | accelerometer.delegate = self; 17 | self->gyroHandler = gyroHandler; 18 | } 19 | 20 | - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{ 21 | //gyroHandler->updateAccelerometerData(acceleration.x, acceleration.y, acceleration.z); 22 | } 23 | 24 | void Kt::GyroHandler::configAccelerometer(int updateInterval){ 25 | [[Motion the]configureAccelerometerWithGyroHandler:this AndUpdateInterval:updateInterval]; 26 | }; 27 | */ 28 | @end 29 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics3/Texture.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Texture.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | #ifndef KORE_G4 11 | 12 | Graphics3::Texture::Texture(Kore::Reader& reader, const char* format, bool readable) : Image(reader, format, readable) { 13 | init(format, readable); 14 | } 15 | 16 | Graphics3::Texture::Texture(const char* filename, bool readable) { 17 | FileReader reader(filename); 18 | Image::init(reader, filename, readable); 19 | init(filename, readable); 20 | } 21 | 22 | Graphics3::Texture::Texture(void* data, int size, const char* format, bool readable) { 23 | BufferReader reader(data, size); 24 | Image::init(reader, format, readable); 25 | init(format, readable); 26 | } 27 | 28 | Graphics3::Texture::Texture(void* data, int width, int height, int format, bool readable) : Image(data, width, height, Image::Format(format), readable) { 29 | init("", readable); 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Backends/System/Tizen/Sources/Kore/GlRendererTemplate.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLRENDERERTEMPLATE_H_ 2 | #define _GLRENDERERTEMPLATE_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class GlRendererTemplate : public Tizen::Graphics::Opengl::IGlRenderer { 14 | public: 15 | GlRendererTemplate(void); 16 | ~GlRendererTemplate(void); 17 | 18 | virtual bool InitializeGl(void); 19 | virtual bool TerminateGl(void); 20 | 21 | virtual bool Draw(void); 22 | 23 | virtual bool Pause(void); 24 | virtual bool Resume(void); 25 | 26 | virtual int GetTargetControlWidth(void); 27 | virtual int GetTargetControlHeight(void); 28 | virtual void SetTargetControlWidth(int width); 29 | virtual void SetTargetControlHeight(int height); 30 | 31 | private: 32 | int __controlWidth; 33 | int __controlHeight; 34 | int __angle; 35 | }; 36 | 37 | #endif /* _GLRENDERERTEMPLATE_H_ */ 38 | -------------------------------------------------------------------------------- /Backends/Graphics5/Direct3D12/Sources/Kore/RenderTarget5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D12Resource; 4 | struct ID3D12DescriptorHeap; 5 | 6 | namespace Kore { 7 | struct D3D12Viewport { 8 | float TopLeftX; 9 | float TopLeftY; 10 | float Width; 11 | float Height; 12 | float MinDepth; 13 | float MaxDepth; 14 | }; 15 | 16 | struct D3D12Rect { 17 | long left; 18 | long top; 19 | long right; 20 | long bottom; 21 | }; 22 | 23 | enum RenderTargetResourceState { RenderTargetResourceStateUndefined, RenderTargetResourceStateRenderTarget, RenderTargetResourceStateTexture }; 24 | 25 | class RenderTarget5Impl { 26 | public: 27 | ID3D12Resource* renderTarget; 28 | ID3D12DescriptorHeap* renderTargetDescriptorHeap; 29 | ID3D12DescriptorHeap* srvDescriptorHeap; 30 | ID3D12DescriptorHeap* depthStencilDescriptorHeap; 31 | ID3D12Resource* depthStencilTexture; 32 | D3D12Viewport viewport; 33 | D3D12Rect scissor; 34 | int stage; 35 | RenderTargetResourceState resourceState; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/ShaderImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "ogl.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | using namespace Kore; 12 | 13 | ShaderImpl::ShaderImpl(void* data, int length) : length(length), _glid(0) { 14 | char* source = new char[length + 1]; 15 | for (int i = 0; i < length; ++i) { 16 | source[i] = ((char*)data)[i]; 17 | } 18 | source[length] = 0; 19 | this->source = source; 20 | } 21 | 22 | ShaderImpl::ShaderImpl(const char* source) : source(source), length(strlen(source)), _glid(0) {} 23 | 24 | ShaderImpl::~ShaderImpl() { 25 | delete[] source; 26 | source = nullptr; 27 | if (_glid != 0) glDeleteShader(_glid); 28 | } 29 | 30 | Graphics4::Shader::Shader(void* data, int length, ShaderType type) : ShaderImpl(data, length) { 31 | setId(); 32 | } 33 | 34 | Graphics4::Shader::Shader(const char* source, ShaderType type) : ShaderImpl(source) { 35 | setId(); 36 | } 37 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/RenderTarget5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "RenderTarget5Impl.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | Graphics5::RenderTarget::RenderTarget(int width, int height, int depthBufferBits, bool antialiasing, RenderTargetFormat format, int stencilBufferBits, 11 | int contextId) { 12 | this->texWidth = this->width = width; 13 | this->texHeight = this->height = height; 14 | } 15 | 16 | Graphics5::RenderTarget::RenderTarget(int cubeMapSize, int depthBufferBits, bool antialiasing, RenderTargetFormat format, int stencilBufferBits, 17 | int contextId) {} 18 | 19 | Graphics5::RenderTarget::~RenderTarget() {} 20 | 21 | void Graphics5::RenderTarget::useColorAsTexture(TextureUnit unit) {} 22 | 23 | void Graphics5::RenderTarget::useDepthAsTexture(TextureUnit unit) {} 24 | 25 | void Graphics5::RenderTarget::setDepthStencilFrom(RenderTarget* source) {} 26 | -------------------------------------------------------------------------------- /Backends/Graphics5/Vulkan/Sources/Kore/Texture5Impl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #ifdef min 7 | #undef min 8 | #endif 9 | 10 | #ifdef max 11 | #undef max 12 | #endif 13 | 14 | #ifdef RegisterClass 15 | #undef RegisterClass 16 | #endif 17 | 18 | namespace Kore { 19 | struct texture_object { 20 | VkSampler sampler; 21 | 22 | VkImage image; 23 | VkImageLayout imageLayout; 24 | 25 | VkDeviceMemory mem; 26 | VkImageView view; 27 | int32_t tex_width, tex_height; 28 | }; 29 | 30 | namespace Graphics5 { 31 | class Texture; 32 | } 33 | 34 | class TextureUnit5Impl { 35 | public: 36 | int binding; 37 | }; 38 | 39 | class Texture5Impl { 40 | protected: 41 | // static TreeMap images; 42 | public: 43 | u8 pixfmt; 44 | 45 | texture_object texture; 46 | VkDeviceSize deviceSize; 47 | 48 | VkDescriptorSet desc_set; 49 | 50 | ~Texture5Impl(); 51 | u8* conversionBuffer; // Fuer wenn Textur aus Image erstellt wird 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /Sources/Kore/Error.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Error.h" 4 | #include "ErrorArgs.h" 5 | #include "Log.h" 6 | #include "LogArgs.h" 7 | 8 | #include 9 | 10 | using namespace Kore; 11 | 12 | void Kore::affirm(bool b) { 13 | if (!b) error(); 14 | } 15 | 16 | void Kore::affirm(bool b, const char* format, ...) { 17 | if (!b) { 18 | va_list args; 19 | va_start(args, format); 20 | errorArgs(format, args); 21 | va_end(args); 22 | } 23 | } 24 | 25 | void Kore::affirmArgs(bool b, const char* format, va_list args) { 26 | if (!b) { 27 | errorArgs(format, args); 28 | } 29 | } 30 | 31 | void Kore::error() { 32 | error("Unknown error"); 33 | } 34 | 35 | void Kore::error(const char* format, ...) { 36 | va_list args; 37 | va_start(args, format); 38 | logArgs(Error, format, args); 39 | va_end(args); 40 | exit(EXIT_FAILURE); 41 | } 42 | 43 | void Kore::errorArgs(const char* format, va_list args) { 44 | logArgs(Error, format, args); 45 | exit(EXIT_FAILURE); 46 | } 47 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/PipelineState5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "PipelineState5Impl.h" 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | using namespace Kore; 11 | 12 | PipelineState5Impl::PipelineState5Impl() { 13 | state = new Graphics4::PipelineState(); 14 | } 15 | 16 | Graphics5::ConstantLocation Graphics5::PipelineState::getConstantLocation(const char* name) { 17 | ConstantLocation location; 18 | location.location = new Graphics4::ConstantLocation(state->getConstantLocation(name)); 19 | return location; 20 | } 21 | 22 | Graphics5::TextureUnit Graphics5::PipelineState::getTextureUnit(const char* name) { 23 | TextureUnit unit; 24 | unit.unit = 0; 25 | return unit; 26 | } 27 | 28 | void Graphics5::PipelineState::compile() { 29 | state->inputLayout[0] = inputLayout[0]; 30 | state->vertexShader = vertexShader->shader; 31 | state->fragmentShader = fragmentShader->shader; 32 | state->compile(); 33 | } 34 | -------------------------------------------------------------------------------- /Sources/Kore/Math/Quaternion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Matrix.h" 4 | 5 | namespace Kore { 6 | class Quaternion { 7 | public: 8 | Quaternion(); 9 | Quaternion(float x, float y, float z, float w); 10 | Quaternion(const vec3& axis, float radians); 11 | Quaternion slerp(float t, const Quaternion& q) const; 12 | Quaternion rotated(const Quaternion& b) const; 13 | Quaternion scaled(float scale) const; 14 | float dot(const Quaternion& q) const; 15 | mat4 matrix() const; 16 | Quaternion operator+(const Quaternion& q) const; 17 | Quaternion operator+(const vec3& v) const; 18 | void operator+=(const vec3& v); 19 | Quaternion operator*(const Quaternion& r) const; 20 | Quaternion operator-(const Quaternion& q) const; 21 | bool operator==(const Quaternion& q) const; 22 | bool operator!=(const Quaternion& q) const; 23 | void normalize(); 24 | void rotate(const Quaternion& q2); 25 | Quaternion conjugate() const; 26 | Quaternion invert() const; 27 | 28 | float x, y, z, w; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/DirectShow/BaseClasses/seekpt.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: SeekPT.h 3 | // 4 | // Desc: DirectShow base classes. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __seekpt_h__ 11 | #define __seekpt_h__ 12 | 13 | 14 | class CSeekingPassThru : public ISeekingPassThru, public CUnknown 15 | { 16 | public: 17 | static CUnknown *CreateInstance(__inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 18 | CSeekingPassThru(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 19 | ~CSeekingPassThru(); 20 | 21 | DECLARE_IUNKNOWN; 22 | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv); 23 | 24 | STDMETHODIMP Init(BOOL bSupportRendering, IPin *pPin); 25 | 26 | private: 27 | CPosPassThru *m_pPosPassThru; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Sources/Kore/IO/FileWriter.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "FileWriter.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace Kore; 12 | 13 | FileWriter::FileWriter() : file(nullptr) {} 14 | 15 | FileWriter::FileWriter(const char* filepath) : file(nullptr) { 16 | if (!open(filepath)) { 17 | error("Could not open file %s.", filepath); 18 | } 19 | } 20 | 21 | bool FileWriter::open(const char* filepath) { 22 | char path[1001]; 23 | strcpy(path, System::savePath()); 24 | strcat(path, filepath); 25 | file = fopen(path, "wb"); 26 | if (file == nullptr) { 27 | log(Warning, "Could not open file %s.", filepath); 28 | return false; 29 | } 30 | return true; 31 | } 32 | 33 | void FileWriter::close() { 34 | if (file == nullptr) return; 35 | fclose((FILE*)file); 36 | file = nullptr; 37 | } 38 | 39 | FileWriter::~FileWriter() { 40 | close(); 41 | } 42 | 43 | void FileWriter::write(void* data, int size) { 44 | fwrite(data, 1, size, (FILE*)file); 45 | } 46 | -------------------------------------------------------------------------------- /Backends/Graphics4/OpenGL/Sources/Kore/TextureArrayImpl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | using namespace Kore; 8 | using namespace Kore::Graphics4; 9 | 10 | TextureArray::TextureArray(Image** textures, int count) { 11 | #ifdef GL_VERSION_4_2 12 | glGenTextures(1, &texture); 13 | glBindTexture(GL_TEXTURE_2D_ARRAY, texture); 14 | // glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, textures[0]->width, textures[0]->height, count, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); 15 | glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, textures[0]->width, textures[0]->height, count); 16 | for (int i = 0; i < count; ++i) { 17 | glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, i, textures[i]->width, textures[i]->height, 1, GL_RGBA, GL_UNSIGNED_BYTE, textures[i]->data); 18 | } 19 | #endif 20 | } 21 | 22 | void TextureArrayImpl::set(TextureUnit unit) { 23 | #ifdef GL_VERSION_4_2 24 | glActiveTexture(GL_TEXTURE0 + unit.unit); 25 | glBindTexture(GL_TEXTURE_2D_ARRAY, texture); 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/WinError.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "WinError.h" 4 | 5 | #include 6 | 7 | #include 8 | 9 | #define S_OK ((HRESULT)0L) 10 | 11 | namespace { 12 | void winerror(HRESULT result) { 13 | LPVOID buffer = nullptr; 14 | DWORD dw = GetLastError(); 15 | 16 | if (dw != 0) { 17 | FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, 18 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&buffer, 0, NULL); 19 | 20 | Kore::error("Error: %s", buffer); 21 | } 22 | else { 23 | Kore::error("Unknown Windows error, return value was 0x%x.", result); 24 | } 25 | } 26 | } 27 | 28 | void Kore::affirm(HRESULT result) { 29 | if (result != S_OK) { 30 | winerror(result); 31 | } 32 | } 33 | 34 | void Kore::affirm(HRESULT result, const char* format, ...) { 35 | va_list args; 36 | va_start(args, format); 37 | affirmArgs(result == S_OK, format, args); 38 | va_end(args); 39 | } 40 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/GLViewController.mm: -------------------------------------------------------------------------------- 1 | #import "GLViewController.h" 2 | #import "GLView.h" 3 | #include "pch.h" 4 | #import 5 | #include 6 | #include 7 | 8 | static GLView* glView; 9 | 10 | void beginGL() { 11 | [glView begin]; 12 | } 13 | 14 | void endGL() { 15 | [glView end]; 16 | } 17 | 18 | void showKeyboard() { 19 | [glView showKeyboard]; 20 | } 21 | 22 | void hideKeyboard() { 23 | [glView hideKeyboard]; 24 | } 25 | 26 | id getMetalDevice() { 27 | #ifdef SYS_METAL 28 | return [glView metalDevice]; 29 | #else 30 | return nil; 31 | #endif 32 | } 33 | 34 | id getMetalLibrary() { 35 | #ifdef SYS_METAL 36 | return [glView metalLibrary]; 37 | #else 38 | return nil; 39 | #endif 40 | } 41 | 42 | id getMetalEncoder() { 43 | #ifdef SYS_METAL 44 | return [glView metalEncoder]; 45 | #else 46 | return nil; 47 | #endif 48 | } 49 | 50 | @implementation GLViewController 51 | 52 | - (void)loadView { 53 | self.view = glView = [[GLView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Sources/Kore/IO/Writer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Writer { 5 | public: 6 | virtual ~Writer() {} 7 | virtual void write(void* data, int size) = 0; 8 | 9 | void writeLE(float value); 10 | void writeBE(float value); 11 | void writeU32LE(u32 value); 12 | void writeU32BE(u32 value); 13 | void writeS32LE(s32 value); 14 | void writeS32BE(s32 value); 15 | void writeU16LE(u16 value); 16 | void writeU16BE(u16 value); 17 | void writeS16LE(s16 value); 18 | void writeS16BE(s16 value); 19 | void writeU8(u8 value); 20 | void writeS8(s8 value); 21 | 22 | static void writeLE(float value, u8* data); 23 | static void writeBE(float value, u8* data); 24 | static void writeLE(u32 value, u8* data); 25 | static void writeBE(u32 value, u8* data); 26 | static void writeLE(s32 value, u8* data); 27 | static void writeBE(s32 value, u8* data); 28 | static void writeLE(u16 value, u8* data); 29 | static void writeBE(u16 value, u8* data); 30 | static void writeLE(s16 value, u8* data); 31 | static void writeBE(s16 value, u8* data); 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/PipelineStateImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ID3D11InputLayout; 4 | struct ID3D11PixelShader; 5 | struct ID3D11VertexShader; 6 | struct ID3D11Buffer; 7 | struct ID3D11DepthStencilState; 8 | struct ID3D11RasterizerState; 9 | struct ID3D11BlendState; 10 | 11 | namespace Kore { 12 | namespace Graphics4 { 13 | class PipelineState; 14 | class Shader; 15 | } 16 | 17 | class PipelineStateImpl { 18 | public: 19 | PipelineStateImpl(); 20 | ID3D11InputLayout* d3d11inputLayout; 21 | ID3D11Buffer* fragmentConstantBuffer; 22 | ID3D11Buffer* vertexConstantBuffer; 23 | ID3D11Buffer* geometryConstantBuffer; 24 | ID3D11Buffer* tessEvalConstantBuffer; 25 | ID3D11Buffer* tessControlConstantBuffer; 26 | ID3D11DepthStencilState* depthStencilState; 27 | ID3D11RasterizerState* rasterizerState; 28 | ID3D11RasterizerState* rasterizerStateScissor; 29 | ID3D11BlendState* blendState; 30 | void set(Graphics4::PipelineState* pipeline, bool scissoring); 31 | void setRasterizerState(bool scissoring); 32 | static void setConstants(); 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /Sources/Kore/IO/FileReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Reader.h" 4 | 5 | #ifndef KORE_DEBUGDIR 6 | #define KORE_DEBUGDIR "Deployment" 7 | #endif 8 | 9 | #ifdef KORE_ANDROID 10 | struct AAsset; 11 | struct __sFILE; 12 | typedef __sFILE FILE; 13 | #endif 14 | 15 | namespace Kore { 16 | #ifdef KORE_ANDROID 17 | struct FileReaderData { 18 | int pos; 19 | int size; 20 | FILE* file; 21 | AAsset* asset; 22 | }; 23 | #else 24 | struct FileReaderData { 25 | void* file; 26 | int size; 27 | }; 28 | #endif 29 | 30 | class FileReader : public Reader { 31 | public: 32 | enum FileType { Asset, Save }; 33 | 34 | FileReader(); 35 | FileReader(const char* filename, FileType type = Asset); 36 | ~FileReader(); 37 | bool open(const char* filename, FileType type = Asset); 38 | void close(); 39 | int read(void* data, int size) override; 40 | void* readAll() override; 41 | int size() const override; 42 | int pos() const override; 43 | void seek(int pos) override; 44 | 45 | FileReaderData data; 46 | void* readdata; 47 | }; 48 | 49 | void setFilesLocation(char* dir); 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Kore/Threads/Mutex.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #if !defined(KORE_WINDOWS) && !defined(KORE_WINDOWSAPP) && defined(KORE_POSIX) 6 | #include 7 | #endif 8 | 9 | namespace Kore { 10 | class Mutex : public MutexImpl { 11 | public: 12 | void create(); 13 | void destroy(); 14 | void lock(); 15 | bool tryToLock(); 16 | void unlock(); 17 | 18 | private: 19 | #if defined(KORE_WINDOWS) || defined(KORE_WINDOWSAPP) || defined(KORE_XBOX_ONE) 20 | struct CriticalSection { 21 | void* DebugInfo; 22 | long LockCount; 23 | long RecursionCount; 24 | void* OwningThread; 25 | void* LockSemaphore; 26 | unsigned long __w64 SpinCount; 27 | } criticalSection; 28 | #elif defined(KORE_POSIX) 29 | pthread_mutex_t pthread_mutex; 30 | #endif 31 | }; 32 | 33 | class UberMutex { 34 | public: 35 | #if defined(KORE_WINDOWS) || defined(KORE_WINDOWSAPP) 36 | void* id; 37 | #endif 38 | 39 | bool create(const wchar_t* name); 40 | void destroy(); 41 | void lock(); 42 | void unlock(); 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /Sources/Kore/Math/Random.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Random.h" 4 | 5 | using namespace Kore; 6 | 7 | // MT19937 8 | 9 | namespace { 10 | s32 MT[624]; 11 | int index = 0; 12 | 13 | void generateNumbers() { 14 | for (int i = 0; i < 624; ++i) { 15 | int y = (MT[i] & 1) + (MT[(i + 1) % 624]) & 0x7fffffff; 16 | MT[i] = MT[(i + 397) % 624] ^ (y >> 1); 17 | if ((y % 2) != 0) MT[i] = MT[i] ^ 0x9908b0df; 18 | } 19 | } 20 | } 21 | 22 | void Random::init(int seed) { 23 | MT[0] = seed; 24 | for (int i = 1; i < 624; ++i) MT[i] = 0x6c078965 * (MT[i - 1] ^ (MT[i - 1] >> 30)) + i; 25 | } 26 | 27 | s32 Random::get() { 28 | if (index == 0) generateNumbers(); 29 | 30 | s32 y = MT[index]; 31 | y = y ^ (y >> 11); 32 | y = y ^ ((y << 7) & (0x9d2c5680)); 33 | y = y ^ ((y << 15) & (0xefc60000)); 34 | y = y ^ (y >> 18); 35 | 36 | index = (index + 1) % 624; 37 | return y; 38 | } 39 | 40 | s32 Random::get(s32 max) { 41 | return Random::get() % (max + 1); 42 | } 43 | 44 | s32 Random::get(s32 min, s32 max) { 45 | return Random::get() % (max + 1 - min) + min; 46 | } -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace Kore { 5 | class VideoSoundStream; 6 | 7 | class Video { 8 | private: 9 | void* assetReader; 10 | void* videoTrackOutput; 11 | void* audioTrackOutput; 12 | void updateImage(); 13 | double start; 14 | double next; 15 | // double audioTime; 16 | unsigned long long audioTime; 17 | bool playing; 18 | VideoSoundStream* sound; 19 | 20 | public: 21 | Video(const char* filename); 22 | ~Video(); 23 | void play(); 24 | void pause(); 25 | void stop(); 26 | int width(); 27 | int height(); 28 | Graphics4::Texture* currentImage(); 29 | double duration; // milliseconds 30 | double position; // milliseconds 31 | bool finished; 32 | bool paused; 33 | void update(double time); 34 | void* androidVideo; 35 | int id; 36 | 37 | private: 38 | Graphics4::Texture* image; 39 | double lastTime; 40 | int myWidth; 41 | int myHeight; 42 | 43 | private: 44 | void video_write(); 45 | Kore::Graphics4::Image* videoImage; 46 | FileReader* infile; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /Backends/System/Apple/Sources/Kore/Video.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | //#include 4 | 5 | namespace Kore { 6 | class VideoSoundStream; 7 | 8 | class Video { 9 | private: 10 | void updateImage(); 11 | double start; 12 | double videoStart; 13 | double next; 14 | // double audioTime; 15 | unsigned long long audioTime; 16 | bool playing; 17 | VideoSoundStream* sound; 18 | void load(double startTime); 19 | 20 | public: 21 | Video(const char* filename); 22 | ~Video(); 23 | void play(); 24 | void pause(); 25 | void stop(); 26 | int width(); 27 | int height(); 28 | Graphics4::Texture* currentImage(); 29 | double duration; // milliseconds 30 | double position; // milliseconds 31 | bool finished; 32 | bool paused; 33 | void update(double time); 34 | 35 | private: 36 | Graphics4::Texture* image; 37 | double lastTime; 38 | int myWidth; 39 | int myHeight; 40 | 41 | private: 42 | void video_write(); 43 | Kore::Graphics4::Image* videoImage; 44 | FileReader* infile; 45 | 46 | struct Impl; 47 | Impl* impl; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/SteamVR/src/vrcommon/sharedlibtools_public.cpp: -------------------------------------------------------------------------------- 1 | //========= Copyright Valve Corporation ============// 2 | #include "sharedlibtools_public.h" 3 | #include 4 | 5 | #if defined(_WIN32) 6 | #include 7 | #endif 8 | 9 | #if defined(POSIX) 10 | #include 11 | #endif 12 | 13 | SharedLibHandle SharedLib_Load( const char *pchPath ) 14 | { 15 | #if defined( _WIN32) 16 | return (SharedLibHandle)LoadLibraryExA( pchPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); 17 | #elif defined(POSIX) 18 | return (SharedLibHandle)dlopen(pchPath, RTLD_LOCAL|RTLD_NOW); 19 | #endif 20 | } 21 | 22 | void *SharedLib_GetFunction( SharedLibHandle lib, const char *pchFunctionName) 23 | { 24 | #if defined( _WIN32) 25 | return GetProcAddress( (HMODULE)lib, pchFunctionName ); 26 | #elif defined(POSIX) 27 | return dlsym( lib, pchFunctionName ); 28 | #endif 29 | } 30 | 31 | 32 | void SharedLib_Unload( SharedLibHandle lib ) 33 | { 34 | #if defined( _WIN32) 35 | FreeLibrary( (HMODULE)lib ); 36 | #elif defined(POSIX) 37 | dlclose( lib ); 38 | #endif 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /Backends/System/Windows/Libraries/DirectShow/BaseClasses/ddmm.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DDMM.h 3 | // 4 | // Desc: DirectShow base classes - efines routines for using DirectDraw 5 | // on a multimonitor system. 6 | // 7 | // Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifdef __cplusplus 12 | extern "C" { /* Assume C declarations for C++ */ 13 | #endif /* __cplusplus */ 14 | 15 | // DDRAW.H might not include these 16 | #ifndef DDENUM_ATTACHEDSECONDARYDEVICES 17 | #define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L 18 | #endif 19 | 20 | typedef HRESULT (*PDRAWCREATE)(IID *,LPDIRECTDRAW *,LPUNKNOWN); 21 | typedef HRESULT (*PDRAWENUM)(LPDDENUMCALLBACKA, LPVOID); 22 | 23 | IDirectDraw * DirectDrawCreateFromDevice(__in_opt LPSTR, PDRAWCREATE, PDRAWENUM); 24 | IDirectDraw * DirectDrawCreateFromDeviceEx(__in_opt LPSTR, PDRAWCREATE, LPDIRECTDRAWENUMERATEEXA); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif /* __cplusplus */ 29 | -------------------------------------------------------------------------------- /Backends/Graphics4/Direct3D11/Sources/Kore/ShaderImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace Kore { 7 | struct ShaderConstant { 8 | u32 offset; 9 | u32 size; 10 | u8 columns; 11 | u8 rows; 12 | }; 13 | 14 | class ShaderImpl { 15 | public: 16 | ShaderImpl(); 17 | std::map constants; 18 | int constantsSize; 19 | std::map attributes; 20 | std::map textures; 21 | void* shader; 22 | u8* data; 23 | int length; 24 | }; 25 | 26 | class ConstantLocationImpl { 27 | public: 28 | u32 vertexOffset; 29 | u32 vertexSize; 30 | u32 fragmentOffset; 31 | u32 fragmentSize; 32 | u32 geometryOffset; 33 | u32 geometrySize; 34 | u32 tessEvalOffset; 35 | u32 tessEvalSize; 36 | u32 tessControlOffset; 37 | u32 tessControlSize; 38 | u8 vertexColumns; 39 | u8 vertexRows; 40 | u8 fragmentColumns; 41 | u8 fragmentRows; 42 | u8 geometryColumns; 43 | u8 geometryRows; 44 | u8 tessEvalColumns; 45 | u8 tessEvalRows; 46 | u8 tessControlColumns; 47 | u8 tessControlRows; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/VertexBuffer5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "VertexBuffer5Impl.h" 4 | 5 | #include 6 | 7 | #include 8 | 9 | using namespace Kore; 10 | 11 | VertexBuffer5Impl* VertexBuffer5Impl::_current = nullptr; 12 | 13 | VertexBuffer5Impl::VertexBuffer5Impl(int count) : myCount(count), myStart(0) {} 14 | 15 | Graphics5::VertexBuffer::VertexBuffer(int count, const VertexStructure& structure, bool gpuMemory, int instanceDataStepRate) : VertexBuffer5Impl(count) { 16 | buffer = new Graphics4::VertexBuffer(count, structure, instanceDataStepRate); 17 | } 18 | 19 | Graphics5::VertexBuffer::~VertexBuffer() { 20 | delete buffer; 21 | } 22 | 23 | float* Graphics5::VertexBuffer::lock() { 24 | return lock(0, count()); 25 | } 26 | 27 | float* Graphics5::VertexBuffer::lock(int start, int count) { 28 | return buffer->lock(start, count); 29 | } 30 | 31 | void Graphics5::VertexBuffer::unlock() { 32 | buffer->unlock(); 33 | } 34 | 35 | int Graphics5::VertexBuffer::count() { 36 | return myCount; 37 | } 38 | 39 | int Graphics5::VertexBuffer::stride() { 40 | return myStride; 41 | } 42 | -------------------------------------------------------------------------------- /Sources/Kore/CodeStyle.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | class StyleExample { // upper camel case class names 4 | public: // public on top 5 | StyleExample() { // egyptian style curly brackets 6 | } 7 | 8 | void doIt() { // lower camel case method and function names 9 | int i = 1; 10 | switch (i) { 11 | case 1: // case in same column as switch 12 | playSfx(2); 13 | break; 14 | } 15 | } 16 | // lower camel case for parameters and 17 | // locals, camel case is used for 18 | // akronyms, too 19 | virtual void playSfx(int soundId) {} 20 | 21 | private: 22 | int mySoundId; // members in lower camel case starting with "my" 23 | }; 24 | 25 | class StyleExample2 : public StyleExample { 26 | public: 27 | // use the C++0x nullptr keyword - already 28 | // supported in VS2010, defined to NULL for all 29 | // other compilers 30 | StyleExample2() : myExample(nullptr) {} 31 | 32 | // use the C++0x override keyword - already 33 | // supported in VS2010, defined to nothing 34 | // for all other compilers 35 | virtual void playSfx(int soundId) override {} 36 | 37 | private: 38 | StyleExample* myExample; 39 | }; 40 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Input/HIDGamepad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Kore { 8 | class HIDGamepad { 9 | private: 10 | IOHIDDeviceRef deviceRef; 11 | IOHIDQueueRef inIOHIDQueueRef; 12 | int padIndex; 13 | 14 | void initHIDDevice(); 15 | 16 | static void inputValueCallback(void* inContext, IOReturn inResult, void* inSender, IOHIDValueRef inIOHIDValueRef); 17 | static void valueAvailableCallback(void* inContext, IOReturn inResult, void* inSender); 18 | static void deviceRemovalCallback(void* inContext, IOReturn inResult, void* inSender); 19 | 20 | void initElementsFromArray(CFArrayRef elements); 21 | 22 | void buttonChanged(IOHIDElementRef elementRef, IOHIDValueRef valueRef, int buttonIndex); 23 | void axisChanged(IOHIDElementRef elementRef, IOHIDValueRef valueRef, int axisIndex); 24 | 25 | public: 26 | HIDGamepad(IOHIDDeviceRef deviceRef, int ID); 27 | ~HIDGamepad(); 28 | 29 | // Property functions 30 | int getVendorID(); 31 | int getProductID(); 32 | char* getProductKey(); 33 | char* getManufacturerKey(); 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Kore/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | typedef unsigned char u8; // 1 Byte 5 | typedef unsigned short u16; // 2 Byte 6 | typedef unsigned int u32; // 4 Byte 7 | 8 | #if defined(__LP64__) || defined(_LP64) 9 | #define KORE_64 10 | #endif 11 | 12 | #ifdef KORE_WINDOWS 13 | typedef unsigned __int64 u64; // 8 Byte 14 | #else 15 | typedef unsigned long long u64; 16 | #endif 17 | typedef char s8; // 1 Byte 18 | typedef short s16; // 2 Byte 19 | typedef int s32; // 4 Byte 20 | #ifdef KORE_WINDOWS 21 | typedef __int64 s64; // 8 Byte 22 | #else 23 | typedef long long s64; 24 | #endif 25 | 26 | typedef u32 uint; // 4 Byte 27 | typedef s32 sint; // 4 Byte 28 | 29 | #ifdef KORE_64 30 | typedef s64 spint; 31 | typedef u64 upint; 32 | #else 33 | typedef s32 spint; 34 | typedef u32 upint; 35 | #endif 36 | } 37 | 38 | #if defined(KORE_PPC) 39 | #define KORE_BIG_ENDIAN 40 | #else 41 | #define KORE_LITTLE_ENDIAN 42 | #endif 43 | 44 | // pseudo C++11 45 | #if !defined(KORE_WINDOWS) && !defined(KORE_WINDOWSAPP) && !defined(KORE_XBOX_ONE) && __cplusplus <= 199711L 46 | #define nullptr 0 47 | #define override 48 | #endif 49 | 50 | #define Noexcept throw() 51 | -------------------------------------------------------------------------------- /Backends/System/Windows/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | void Mouse::_lock(int windowId, bool truth) { 11 | show(!truth); 12 | if (truth) { 13 | HWND hwnd = (HWND)Kore::System::windowHandle(windowId); 14 | SetCapture(hwnd); 15 | RECT rect; 16 | GetWindowRect(hwnd, &rect); 17 | ClipCursor(&rect); 18 | } 19 | else { 20 | ReleaseCapture(); 21 | ClipCursor(NULL); 22 | } 23 | } 24 | 25 | bool Mouse::canLock(int windowId) { 26 | return true; 27 | } 28 | 29 | void Mouse::show(bool truth) { 30 | ShowCursor(truth); 31 | } 32 | 33 | void Mouse::setPosition(int windowId, int x, int y) { 34 | HWND hwnd = (HWND)Kore::System::windowHandle(windowId); 35 | POINT point; 36 | point.x = x; 37 | point.y = y; 38 | ClientToScreen(hwnd, &point); 39 | SetCursorPos(point.x, point.y); 40 | } 41 | 42 | void Mouse::getPosition(int windowId, int& x, int& y) { 43 | POINT point; 44 | GetCursorPos(&point); 45 | HWND hwnd = (HWND)Kore::System::windowHandle(windowId); 46 | ScreenToClient(hwnd, &point); 47 | x = point.x; 48 | y = point.y; 49 | } 50 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/ConstantBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Kore { 8 | namespace Graphics5 { 9 | class ConstantBuffer : public ConstantBuffer5Impl { 10 | public: 11 | ConstantBuffer(int size); 12 | ~ConstantBuffer(); 13 | void lock(); 14 | void lock(int start, int count); 15 | void unlock(); 16 | int size(); 17 | 18 | void setBool(int offset, bool value); 19 | void setInt(int offset, int value); 20 | void setFloat(int offset, float value); 21 | void setFloat2(int offset, float value1, float value2); 22 | void setFloat2(int offset, vec2 value); 23 | void setFloat3(int offset, float value1, float value2, float value3); 24 | void setFloat3(int offset, vec3 value); 25 | void setFloat4(int offset, float value1, float value2, float value3, float value4); 26 | void setFloat4(int offset, vec4 value); 27 | void setFloats(int offset, float* values, int count); 28 | void setMatrix(int offset, const mat3& value); 29 | void setMatrix(int offset, const mat4& value); 30 | 31 | private: 32 | u8* data; 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/Texture.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Texture.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace Kore; 9 | 10 | #ifdef KORE_G5ONG4 11 | Graphics4::Texture::Texture(Kore::Reader& reader, const char* format, bool readable) : Image(reader, format, readable) { 12 | init(format, readable); 13 | } 14 | 15 | Graphics4::Texture::Texture(const char* filename, bool readable) { 16 | FileReader reader(filename); 17 | Image::init(reader, filename, readable); 18 | init(filename, readable); 19 | } 20 | 21 | Graphics4::Texture::Texture(void* data, int size, const char* format, bool readable) { 22 | BufferReader reader(data, size); 23 | Image::init(reader, format, readable); 24 | init(format, readable); 25 | } 26 | 27 | Graphics4::Texture::Texture(void* data, int width, int height, int format, bool readable) : Image(data, width, height, Image::Format(format), readable) { 28 | init("", readable); 29 | } 30 | 31 | Graphics4::Texture::Texture(void* data, int width, int height, int depth, int format, bool readable) 32 | : Image(data, width, height, depth, Image::Format(format), readable) { 33 | init3D(readable); 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics5/PipelineState.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "PipelineState.h" 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | Graphics5::PipelineState::PipelineState() { 9 | for (int i = 0; i < 16; ++i) inputLayout[i] = nullptr; 10 | vertexShader = nullptr; 11 | fragmentShader = nullptr; 12 | geometryShader = nullptr; 13 | tessellationControlShader = nullptr; 14 | tessellationEvaluationShader = nullptr; 15 | 16 | cullMode = NoCulling; 17 | 18 | depthWrite = false; 19 | depthMode = ZCompareAlways; 20 | 21 | stencilMode = ZCompareAlways; 22 | stencilBothPass = Keep; 23 | stencilDepthFail = Keep; 24 | stencilFail = Keep; 25 | stencilReferenceValue = 0; 26 | stencilReadMask = 0xff; 27 | stencilWriteMask = 0xff; 28 | 29 | blendSource = BlendOne; 30 | blendDestination = BlendZero; 31 | // blendOperation = BlendingOperation.Add; 32 | alphaBlendSource = BlendOne; 33 | alphaBlendDestination = BlendZero; 34 | // alphaBlendOperation = BlendingOperation.Add; 35 | 36 | colorWriteMaskRed = true; 37 | colorWriteMaskGreen = true; 38 | colorWriteMaskBlue = true; 39 | colorWriteMaskAlpha = true; 40 | } 41 | 42 | Graphics5::PipelineState::~PipelineState() {} 43 | -------------------------------------------------------------------------------- /Backends/System/Android/Sources/Kore/Vr/VrInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef ANDROID 4 | #include 5 | #endif 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | namespace Kore { 15 | 16 | namespace VrInterface { 17 | 18 | #ifdef ANDROID 19 | // Save the JVM. Must be called before Initialize(). 20 | // TODO: Can this be handled better? 21 | void SetJVM(JavaVM* jvm); 22 | #endif 23 | 24 | #ifdef VR_CARDBOARD 25 | void DistortionBefore(); 26 | 27 | void DistortionAfter(); 28 | 29 | void DistortTexture(kha::Image_obj* image); 30 | 31 | void updateGaze(float x, float y, float z, float w); 32 | 33 | kha::math::Quaternion_obj* getGaze(); 34 | 35 | #endif 36 | 37 | #ifdef VR_GEAR_VR 38 | // Calls ovr_enterVrMode 39 | void Initialize(); 40 | 41 | void WarpSwapBlack(); 42 | 43 | void WarpSwapLoadingIcon(); 44 | 45 | kha::vr::SensorState_obj* GetSensorState(); 46 | 47 | kha::vr::SensorState_obj* GetPredictedSensorState(float time); 48 | 49 | double GetTimeInSeconds(); 50 | 51 | void WarpSwap(kha::vr::TimeWarpParms_obj* parms); 52 | 53 | #endif 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Kore/Math/Core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | const float pi = 3.141592654f; 5 | const float tau = 6.283185307f; 6 | float sin(float value); 7 | float cos(float value); 8 | float tan(float x); 9 | float cot(float x); 10 | double round(double value); 11 | float round(float value); 12 | int roundUp(float value); 13 | unsigned pow(unsigned value, unsigned exponent); 14 | float pow(float value, float exponent); 15 | double pow(double value, double exponent); 16 | float maxfloat(); 17 | float sqrt(float value); 18 | float abs(float value); 19 | int abs(int value); 20 | float asin(float value); 21 | float acos(float value); 22 | float atan(float value); 23 | float atan2(float y, float x); 24 | float floor(float value); 25 | float mod(float numer, float denom); 26 | float exp(float exponent); 27 | 28 | template T min(T a, T b) { 29 | return (a < b) ? a : b; 30 | } 31 | 32 | template T max(T a, T b) { 33 | return (a > b) ? a : b; 34 | } 35 | 36 | template T clamp(T value, T minValue, T maxValue) { 37 | const T clampedToMin = value < minValue ? minValue : value; 38 | return clampedToMin > maxValue ? maxValue : clampedToMin; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Kore/IO/BufferReader.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "BufferReader.h" 4 | 5 | #include 6 | #include 7 | 8 | namespace Kore { 9 | 10 | BufferReader::BufferReader(void const* buffer, int size) : buffer((u8*)buffer), bufferSize(size), position(0), readAllBuffer(nullptr) {} 11 | 12 | BufferReader::~BufferReader() { 13 | if (readAllBuffer != nullptr) free(readAllBuffer); 14 | } 15 | 16 | int BufferReader::read(void* data, int size) { 17 | int bytesAvailable = bufferSize - position; 18 | if (size > bytesAvailable) size = bytesAvailable; 19 | memcpy(data, buffer + position, size); 20 | position += size; 21 | return size; 22 | } 23 | 24 | // create a copy of the buffer, because returned buffer can be changed... 25 | void* BufferReader::readAll() { 26 | if (readAllBuffer != nullptr) free(readAllBuffer); 27 | readAllBuffer = malloc(bufferSize); 28 | memcpy(readAllBuffer, buffer, bufferSize); 29 | return readAllBuffer; 30 | } 31 | 32 | int BufferReader::size() const { 33 | return bufferSize; 34 | } 35 | 36 | int BufferReader::pos() const { 37 | return position; 38 | } 39 | 40 | void BufferReader::seek(int pos) { 41 | position = pos < 0 ? 0 : (pos > bufferSize ? bufferSize : pos); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Backends/Graphics5/G5onG4/Sources/Kore/Texture5Impl.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "Texture5Impl.h" 4 | 5 | #include 6 | 7 | using namespace Kore; 8 | 9 | static const int textureCount = 16; 10 | 11 | void Graphics5::Texture::_init(const char* format, bool readable) {} 12 | 13 | Graphics5::Texture::Texture(int width, int height, Format format, bool readable) : Image(width, height, format, readable) {} 14 | 15 | Graphics5::Texture::Texture(int width, int height, int depth, Image::Format format, bool readable) : Image(width, height, depth, format, readable) {} 16 | 17 | Texture5Impl::~Texture5Impl() { 18 | unset(); 19 | } 20 | 21 | void Texture5Impl::unmipmap() { 22 | mipmap = false; 23 | } 24 | 25 | void Graphics5::Texture::_set(TextureUnit unit) {} 26 | 27 | void Texture5Impl::unset() {} 28 | 29 | u8* Graphics5::Texture::lock() { 30 | return nullptr; 31 | } 32 | 33 | void Graphics5::Texture::unlock() {} 34 | 35 | void Graphics5::Texture::clear(int x, int y, int z, int width, int height, int depth, uint color) {} 36 | 37 | int Graphics5::Texture::stride() { 38 | return 32; 39 | } 40 | 41 | void Graphics5::Texture::generateMipmaps(int levels) {} 42 | 43 | void Graphics5::Texture::setMipmap(Texture* mipmap, int level) {} 44 | -------------------------------------------------------------------------------- /Backends/System/iOS/Sources/Kore/GLView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #ifdef SYS_METAL 4 | #import 5 | #import 6 | #else 7 | #import 8 | #import 9 | #endif 10 | #ifndef SYS_TVOS 11 | #import 12 | #endif 13 | 14 | @interface GLView : UIView { 15 | @private 16 | #ifdef SYS_METAL 17 | id device; 18 | id commandQueue; 19 | id commandBuffer; 20 | id commandEncoder; 21 | id drawable; 22 | id library; 23 | MTLRenderPassDescriptor* renderPassDescriptor; 24 | #else 25 | EAGLContext* context; 26 | GLuint defaultFramebuffer, colorRenderbuffer, depthStencilRenderbuffer; 27 | #endif 28 | 29 | #ifndef SYS_TVOS 30 | CMMotionManager* motionManager; 31 | #endif 32 | bool hasAccelerometer; 33 | float lastAccelerometerX, lastAccelerometerY, lastAccelerometerZ; 34 | } 35 | 36 | - (void)begin; 37 | - (void)end; 38 | - (void)showKeyboard; 39 | - (void)hideKeyboard; 40 | #ifdef SYS_METAL 41 | - (id)metalDevice; 42 | - (id)metalLibrary; 43 | - (id)metalEncoder; 44 | #endif 45 | 46 | @end -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.ktxsoftware.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 KTX Software. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics1/Image.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Kore { 4 | class Reader; 5 | 6 | namespace Graphics1 { 7 | enum ImageCompression { ImageCompressionNone, ImageCompressionDXT5, ImageCompressionASTC, ImageCompressionPVRTC }; 8 | 9 | class Image { 10 | public: 11 | enum Format { RGBA32, Grey8, RGB24, RGBA128, RGBA64, A32, BGRA32, A16 }; 12 | 13 | static int sizeOf(Image::Format format); 14 | 15 | Image(int width, int height, Format format, bool readable); 16 | Image(int width, int height, int depth, Format format, bool readable); 17 | Image(const char* filename, bool readable); 18 | Image(Kore::Reader& reader, const char* format, bool readable); 19 | Image(void* data, int width, int height, Format format, bool readable); 20 | Image(void* data, int width, int height, int depth, Format format, bool readable); 21 | virtual ~Image(); 22 | int at(int x, int y); 23 | 24 | int width, height, depth; 25 | Format format; 26 | bool readable; 27 | ImageCompression compression; 28 | u8* data; 29 | float* hdrData; 30 | int dataSize; 31 | unsigned internalFormat; 32 | 33 | protected: 34 | Image(); 35 | void init(Kore::Reader& reader, const char* format, bool readable); 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Backends/System/macOS/Sources/Kore/Display.mm: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #import 4 | 5 | #include "Display.h" 6 | #include 7 | 8 | namespace Kore { 9 | namespace Display { 10 | int count() { 11 | NSArray* screens = [NSScreen screens]; 12 | return [screens count]; 13 | } 14 | 15 | int width(int index) { 16 | NSArray* screens = [NSScreen screens]; 17 | NSScreen* screen = screens[index]; 18 | NSRect rect = [screen frame]; 19 | return rect.size.width; 20 | } 21 | 22 | int height(int index) { 23 | NSArray* screens = [NSScreen screens]; 24 | NSScreen* screen = screens[index]; 25 | NSRect rect = [screen frame]; 26 | return rect.size.height; 27 | } 28 | 29 | int x(int index) { 30 | NSArray* screens = [NSScreen screens]; 31 | NSScreen* screen = screens[index]; 32 | NSRect rect = [screen frame]; 33 | return rect.origin.x; 34 | } 35 | 36 | int y(int index) { 37 | NSArray* screens = [NSScreen screens]; 38 | NSScreen* screen = screens[index]; 39 | NSRect rect = [screen frame]; 40 | return rect.origin.y; 41 | } 42 | 43 | bool isPrimary(int index) { 44 | NSArray* screens = [NSScreen screens]; 45 | NSScreen* mainScreen = [NSScreen mainScreen]; 46 | return mainScreen == screens[index]; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Backends/System/Pi/Sources/Kore/Input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | #include "../pch.h" 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | void Mouse::_lock(int windowId, bool truth) { 9 | show(!truth); 10 | if (truth) { 11 | int width = System::windowWidth(windowId); 12 | int height = System::windowHeight(windowId); 13 | 14 | int x, y; 15 | getPosition(windowId, x, y); 16 | 17 | // Guess the new position of X and Y 18 | int newX = x; 19 | int newY = y; 20 | 21 | // Correct the position of the X coordinate 22 | // if the mouse is out the window 23 | if (x < 0) { 24 | newX -= x; 25 | } 26 | else if (x > width) { 27 | newX -= x - width; 28 | } 29 | 30 | // Correct the position of the Y coordinate 31 | // if the mouse is out the window 32 | if (y < 0) { 33 | newY -= y; 34 | } 35 | else if (y > height) { 36 | newY -= y - height; 37 | } 38 | 39 | // Force the mouse to stay inside the window 40 | setPosition(windowId, newX, newY); 41 | } 42 | } 43 | 44 | bool Mouse::canLock(int windowId) { 45 | return true; 46 | } 47 | 48 | void Mouse::show(bool truth) { 49 | // TODO 50 | } 51 | 52 | void Mouse::setPosition(int windowId, int x, int y) {} 53 | 54 | void Mouse::getPosition(int windowId, int& x, int& y) {} 55 | -------------------------------------------------------------------------------- /Sources/Kore/Graphics4/PipelineState.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | 3 | #include "PipelineState.h" 4 | #include 5 | 6 | using namespace Kore; 7 | 8 | Graphics4::PipelineState::PipelineState() { 9 | static u32 lastId = 0; 10 | id = lastId++; 11 | 12 | for (int i = 0; i < 16; ++i) inputLayout[i] = nullptr; 13 | vertexShader = nullptr; 14 | fragmentShader = nullptr; 15 | geometryShader = nullptr; 16 | tessellationControlShader = nullptr; 17 | tessellationEvaluationShader = nullptr; 18 | 19 | cullMode = NoCulling; 20 | 21 | depthWrite = false; 22 | depthMode = ZCompareAlways; 23 | 24 | stencilMode = ZCompareAlways; 25 | stencilBothPass = Keep; 26 | stencilDepthFail = Keep; 27 | stencilFail = Keep; 28 | stencilReferenceValue = 0; 29 | stencilReadMask = 0xff; 30 | stencilWriteMask = 0xff; 31 | 32 | blendSource = BlendOne; 33 | blendDestination = BlendZero; 34 | // blendOperation = BlendingOperation.Add; 35 | alphaBlendSource = BlendOne; 36 | alphaBlendDestination = BlendZero; 37 | // alphaBlendOperation = BlendingOperation.Add; 38 | 39 | colorWriteMaskRed = true; 40 | colorWriteMaskGreen = true; 41 | colorWriteMaskBlue = true; 42 | colorWriteMaskAlpha = true; 43 | 44 | conservativeRasterization = false; 45 | } 46 | 47 | Graphics4::PipelineState::~PipelineState() {} 48 | --------------------------------------------------------------------------------