restructured project to match a more standard cmake setup

This commit is contained in:
Noel Berry 2020-12-31 13:43:23 -08:00
parent c841bd82a1
commit 241d863ac4
97 changed files with 233 additions and 264 deletions

View File

@ -7,115 +7,65 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(blah add_library(blah
public/blah.h src/core/app.cpp
public/blah/app.cpp src/core/filesystem.cpp
public/blah/app.h src/core/log.cpp
public/blah/filesystem.cpp src/core/time.cpp
public/blah/filesystem.h
public/blah/log.cpp
public/blah/log.h
public/blah/time.cpp
public/blah/time.h
public/blah/graphics/blend.h src/graphics/blend.cpp
public/blah/graphics/blend.cpp src/graphics/framebuffer.cpp
public/blah/graphics/framebuffer.h src/graphics/material.cpp
public/blah/graphics/framebuffer.cpp src/graphics/mesh.cpp
public/blah/graphics/material.h src/graphics/renderpass.cpp
public/blah/graphics/material.cpp src/graphics/shader.cpp
public/blah/graphics/mesh.h src/graphics/texture.cpp
public/blah/graphics/mesh.cpp
public/blah/graphics/renderpass.h
public/blah/graphics/renderpass.cpp
public/blah/graphics/sampler.h
public/blah/graphics/shader.h
public/blah/graphics/shader.cpp
public/blah/graphics/texture.h
public/blah/graphics/texture.cpp
public/blah/input/input.cpp src/input/input.cpp
public/blah/input/virtual_stick.cpp src/input/virtual_stick.cpp
public/blah/input/virtual_stick.h src/input/virtual_button.cpp
public/blah/input/virtual_button.cpp src/input/virtual_axis.cpp
public/blah/input/virtual_button.h
public/blah/input/virtual_axis.cpp
public/blah/input/virtual_axis.h
public/blah/containers/vector.h src/containers/str.cpp
public/blah/containers/stackvector.h
public/blah/containers/str.cpp
public/blah/containers/str.h
public/blah/drawing/batch.cpp src/drawing/batch.cpp
public/blah/drawing/batch.h src/drawing/spritefont.cpp
public/blah/drawing/spritefont.cpp src/drawing/subtexture.cpp
public/blah/drawing/spritefont.h
public/blah/drawing/subtexture.cpp
public/blah/drawing/subtexture.h
public/blah/images/aseprite.cpp src/images/aseprite.cpp
public/blah/images/aseprite.h src/images/font.cpp
public/blah/images/font.cpp src/images/image.cpp
public/blah/images/font.h src/images/packer.cpp
public/blah/images/image.cpp
public/blah/images/image.h
public/blah/images/packer.cpp
public/blah/images/packer.h
public/blah/math/calc.cpp src/math/calc.cpp
public/blah/math/calc.h src/math/circle.cpp
public/blah/math/circle.cpp src/math/color.cpp
public/blah/math/circle.h src/math/line.cpp
public/blah/math/color.cpp src/math/mat3x2.cpp
public/blah/math/color.h src/math/mat4x4.cpp
public/blah/math/ease.h src/math/point.cpp
public/blah/math/line.cpp src/math/quad.cpp
public/blah/math/line.h src/math/rect.cpp
public/blah/math/mat3x2.cpp src/math/rectI.cpp
public/blah/math/mat3x2.h src/math/stopwatch.cpp
public/blah/math/mat4x4.cpp src/math/vec2.cpp
public/blah/math/mat4x4.h
public/blah/math/point.cpp
public/blah/math/point.h
public/blah/math/quad.h
public/blah/math/quad.cpp
public/blah/math/rect.cpp
public/blah/math/rect.h
public/blah/math/rectI.cpp
public/blah/math/rectI.h
public/blah/math/stopwatch.cpp
public/blah/math/stopwatch.h
public/blah/math/vec2.cpp
public/blah/math/vec2.h
public/blah/math/vec4.h
public/blah/streams/endian.h src/streams/bufferstream.cpp
public/blah/streams/bufferstream.cpp src/streams/filestream.cpp
public/blah/streams/bufferstream.h src/streams/memorystream.cpp
public/blah/streams/filestream.cpp src/streams/stream.cpp
public/blah/streams/filestream.h
public/blah/streams/memorystream.cpp
public/blah/streams/memorystream.h
public/blah/streams/stream.cpp
public/blah/streams/stream.h
private/blah/third_party/stb_image.h
private/blah/third_party/stb_image_write.h src/internal/graphics_backend_gl.cpp
private/blah/third_party/stb_truetype.h src/internal/graphics_backend_d3d11.cpp
private/blah/internal/graphics_backend.h src/internal/graphics_backend_dummy.cpp
private/blah/internal/graphics_backend_gl.cpp src/internal/platform_backend_sdl2.cpp
private/blah/internal/graphics_backend_d3d11.cpp
private/blah/internal/graphics_backend_dummy.cpp
private/blah/internal/input_backend.h
private/blah/internal/platform_backend.h
private/blah/internal/platform_backend_sdl2.cpp
) )
target_include_directories(blah target_include_directories(blah
PUBLIC PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/public> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/private> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
) )
# Platform Variables # Platform Variables
@ -127,12 +77,12 @@ set(D3D11_ENABLED false CACHE BOOL "Use D3D11 graphics implementation")
set(LIBS "") set(LIBS "")
# add OpenGL definition if we're using OpenGL # add OpenGL definition if we're using it
if (OPENGL_ENABLED) if (OPENGL_ENABLED)
add_compile_definitions(BLAH_USE_OPENGL) add_compile_definitions(BLAH_USE_OPENGL)
endif() endif()
# add D3D11 definition if we're using D3D11 # add D3D11 definition if we're using it
if (D3D11_ENABLED) if (D3D11_ENABLED)
add_compile_definitions(BLAH_USE_D3D11) add_compile_definitions(BLAH_USE_D3D11)
set(LIBS ${LIBS} d3d11.lib dxguid.lib D3Dcompiler.lib) set(LIBS ${LIBS} d3d11.lib dxguid.lib D3Dcompiler.lib)
@ -145,4 +95,4 @@ if (SDL2_ENABLED)
set(LIBS ${LIBS} ${SDL2_LIBRARIES}) set(LIBS ${LIBS} ${SDL2_LIBRARIES})
endif() endif()
target_link_libraries(blah PUBLIC ${LIBS}) target_link_libraries(blah PUBLIC ${LIBS})

54
include/blah.h Normal file
View File

@ -0,0 +1,54 @@
#pragma once
#include "blah/core/app.h"
#include "blah/core/filesystem.h"
#include "blah/core/log.h"
#include "blah/core/time.h"
#include "blah/containers/vector.h"
#include "blah/containers/stackvector.h"
#include "blah/containers/str.h"
#include "blah/drawing/batch.h"
#include "blah/drawing/spritefont.h"
#include "blah/drawing/subtexture.h"
#include "blah/graphics/blend.h"
#include "blah/graphics/framebuffer.h"
#include "blah/graphics/material.h"
#include "blah/graphics/mesh.h"
#include "blah/graphics/renderpass.h"
#include "blah/graphics/sampler.h"
#include "blah/graphics/shader.h"
#include "blah/graphics/texture.h"
#include "blah/images/aseprite.h"
#include "blah/images/font.h"
#include "blah/images/image.h"
#include "blah/images/packer.h"
#include "blah/input/input.h"
#include "blah/input/virtual_stick.h"
#include "blah/input/virtual_button.h"
#include "blah/input/virtual_axis.h"
#include "blah/math/calc.h"
#include "blah/math/circle.h"
#include "blah/math/color.h"
#include "blah/math/ease.h"
#include "blah/math/line.h"
#include "blah/math/mat3x2.h"
#include "blah/math/mat4x4.h"
#include "blah/math/point.h"
#include "blah/math/quad.h"
#include "blah/math/rect.h"
#include "blah/math/rectI.h"
#include "blah/math/stopwatch.h"
#include "blah/math/vec2.h"
#include "blah/math/vec4.h"
#include "blah/streams/bufferstream.h"
#include "blah/streams/filestream.h"
#include "blah/streams/memorystream.h"
#include "blah/streams/stream.h"
#include "blah/streams/endian.h"

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <blah/log.h> #include <blah/core/log.h>
#include <new> #include <new>
namespace Blah namespace Blah

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <blah/log.h> #include <blah/core/log.h>
#include <type_traits> #include <type_traits>
#include <new> #include <new>

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <blah/graphics/framebuffer.h> #include <memory>
namespace Blah namespace Blah
{ {
@ -40,6 +40,9 @@ namespace Blah
int max_texture_size = 0; int max_texture_size = 0;
}; };
class FrameBuffer;
using FrameBufferRef = std::shared_ptr<FrameBuffer>;
namespace App namespace App
{ {
// Runs the application // Runs the application

View File

@ -11,7 +11,7 @@
#include <blah/graphics/blend.h> #include <blah/graphics/blend.h>
#include <blah/graphics/sampler.h> #include <blah/graphics/sampler.h>
#include <blah/graphics/renderpass.h> #include <blah/graphics/renderpass.h>
#include <blah/app.h> #include <blah/core/app.h>
namespace Blah namespace Blah
{ {

View File

@ -4,6 +4,8 @@
namespace Blah namespace Blah
{ {
// Subtexture is a view into a texture, and can be used to
// easily represent sprites in a larger texture atlas.
struct Subtexture struct Subtexture
{ {
// Reference to our Texture // Reference to our Texture

View File

@ -65,29 +65,28 @@ namespace Blah
BlendMode() = default; BlendMode() = default;
BlendMode(BlendOp op, BlendFactor src, BlendFactor dst) BlendMode(BlendOp op, BlendFactor src, BlendFactor dst) :
{ color_op(op),
color_op = op; color_src(src),
color_src = src; color_dst(dst),
color_dst = dst; alpha_op(op),
alpha_op = op; alpha_src(src),
alpha_src = src; alpha_dst(dst),
alpha_dst = dst; mask(BlendMask::RGBA),
mask = BlendMask::RGBA; rgba(0xffffffff) {}
rgba = 0xffffffff;
}
BlendMode(BlendOp rgbOp, BlendFactor rgbSrc, BlendFactor rgbDst, BlendOp aOp, BlendFactor aSrc, BlendFactor aDst, BlendMask blendMask, uint32_t blendColor) BlendMode(
{ BlendOp color_op, BlendFactor color_src, BlendFactor color_dst,
color_op = rgbOp; BlendOp alpha_op, BlendFactor alpha_src, BlendFactor alpha_dst,
color_src = rgbSrc; BlendMask blend_mask, uint32_t blend_rgba) :
color_dst = rgbDst; color_op(color_op),
alpha_op = aOp; color_src(color_src),
alpha_src = aSrc; color_dst(color_dst),
alpha_dst = aDst; alpha_op(alpha_op),
mask = blendMask; alpha_src(alpha_src),
rgba = blendColor; alpha_dst(alpha_dst),
} mask(blend_mask),
rgba(blend_rgba) {}
bool operator==(const BlendMode& rhs) const bool operator==(const BlendMode& rhs) const
{ {

View File

@ -57,6 +57,8 @@ namespace Blah
TextureSampler get_sampler(int slot, int array_index = 0) const; TextureSampler get_sampler(int slot, int array_index = 0) const;
// Sets the value. `length` is the total number of floats to set // Sets the value. `length` is the total number of floats to set
// For example if the uniform is a float2[4], a total of 8 float values
// can be set.
void set_value(const char* name, const float* value, int64_t length); void set_value(const char* name, const float* value, int64_t length);
// Gets a pointer to the values of the given Uniform, or nullptr if it doesn't exist. // Gets a pointer to the values of the given Uniform, or nullptr if it doesn't exist.

View File

@ -3,7 +3,6 @@
namespace Blah namespace Blah
{ {
enum class TextureFormat enum class TextureFormat
{ {
None, None,

View File

@ -6,6 +6,9 @@
namespace Blah namespace Blah
{ {
// A simple Aseprite file parser.
// This implementation does not support Aseprite blendmodes,
// besides the default blend mode.
class Aseprite class Aseprite
{ {
public: public:

View File

@ -9,7 +9,8 @@
namespace Blah namespace Blah
{ {
// Texture Packer, which takes source images and combines
// them into a single large texture.
class Packer class Packer
{ {
public: public:

View File

@ -412,13 +412,13 @@ namespace Blah
// Gets the Mouse Wheel // Gets the Mouse Wheel
Point mouse_wheel(); Point mouse_wheel();
// Returns 1 if the keyboard key was pressed this frame, and 0 otherwise. // Checks if the keyboard key was pressed this frame
bool pressed(Key key); bool pressed(Key key);
// Returns 1 if the keyboard key was held this frame, and 0 otherwise. // Checks if the keyboard key was held this frame
bool down(Key key); bool down(Key key);
// Returns 1 if the keyboard key was released this frame, and 0 otherwise. // Checks if the keyboard key was released this frame
bool released(Key key); bool released(Key key);
// Checks if the Left or Right Ctrl Key is down // Checks if the Left or Right Ctrl Key is down
@ -435,23 +435,28 @@ namespace Blah
// Gets the controller info for the current controller index. // Gets the controller info for the current controller index.
// If the controller is not connected or the index it out of range, this will set an unconnected controller. // If the controller is not connected or the index it out of range, this will set an unconnected controller.
const ControllerState* controller(int controllerIndex); const ControllerState* controller(int controller_index);
// Returns 1 if the button on the controller was pressed this frame, and 0 otherwise. // Checks if the button on the controller was pressed this frame.
// If the controller is not connected, or the index is out of range, this will return 0. // If the controller is not connected, or the index is out of range, this will return false.
bool pressed(int controllerIndex, Button button); bool pressed(int controller_index, Button button);
// Returns 1 if the button on the controller was held this frame, and 0 otherwise. // Checks if the button on the controller was held this frame.
// If the controller is not connected, or the index is out of range, this will return 0. // If the controller is not connected, or the index is out of range, this will return false.
bool down(int controllerIndex, Button button); bool down(int controller_index, Button button);
// Returns 1 if the button on the controller was released this frame, and 0 otherwise. // Checks if the button on the controller was released this frame.
// If the controller is not connected, or the index is out of range, this will return 0. // If the controller is not connected, or the index is out of range, this will return false.
bool released(int controllerIndex, Button button); bool released(int controller_index, Button button);
float axis_check(int controllerIndex, Axis axis); // returns the value of the given axis
int axis_check(int prev, Key negative, Key positive); float axis_check(int controller_index, Axis axis);
int axis_check(int prev, int controllerIndex, Button negative, Button positive);
// checks the given virtual axis, described by 2 keys. `fallback` is returned if both keys are held
int axis_check(int fallback, Key negative, Key positive);
// checks the given virtual axis, described by 2 buttons. `fallback` is returned if both buttons are held
int axis_check(int fallback, int controller_index, Button negative, Button positive);
// returns a string name of the given key // returns a string name of the given key
const char* name_of(Key key); const char* name_of(Key key);

View File

@ -3,6 +3,8 @@
namespace Blah namespace Blah
{ {
// A virtual controller axis, which can be used to map multiple
// inputs to an axis. Note that you must call `update` every frame!
class VirtualAxis class VirtualAxis
{ {
private: private:

View File

@ -5,6 +5,8 @@
namespace Blah namespace Blah
{ {
// A virtual controller stick, which can be used to map multiple
// inputs to a stick. Note that you must call `update` every frame!
class VirtualStick class VirtualStick
{ {
private: private:

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <blah/math/calc.h> #include <blah/math/calc.h>
#include <blah/log.h> #include <blah/core/log.h>
namespace Blah namespace Blah
{ {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <blah/streams/stream.h> #include <blah/streams/stream.h>
#include <blah/filesystem.h> #include <blah/core/filesystem.h>
namespace Blah namespace Blah
{ {

View File

@ -1,55 +0,0 @@
#pragma once
#include <blah.h>
#include <blah/app.h>
#include <blah/filesystem.h>
#include <blah/log.h>
#include <blah/time.h>
#include <blah/containers/vector.h>
#include <blah/containers/stackvector.h>
#include <blah/containers/str.h>
#include <blah/drawing/batch.h>
#include <blah/drawing/spritefont.h>
#include <blah/drawing/subtexture.h>
#include <blah/graphics/blend.h>
#include <blah/graphics/framebuffer.h>
#include <blah/graphics/material.h>
#include <blah/graphics/mesh.h>
#include <blah/graphics/renderpass.h>
#include <blah/graphics/sampler.h>
#include <blah/graphics/shader.h>
#include <blah/graphics/texture.h>
#include <blah/images/aseprite.h>
#include <blah/images/font.h>
#include <blah/images/image.h>
#include <blah/images/packer.h>
#include <blah/input/input.h>
#include <blah/input/virtual_stick.h>
#include <blah/input/virtual_button.h>
#include <blah/input/virtual_axis.h>
#include <blah/math/calc.h>
#include <blah/math/circle.h>
#include <blah/math/color.h>
#include <blah/math/ease.h>
#include <blah/math/line.h>
#include <blah/math/mat3x2.h>
#include <blah/math/mat4x4.h>
#include <blah/math/point.h>
#include <blah/math/quad.h>
#include <blah/math/rect.h>
#include <blah/math/rectI.h>
#include <blah/math/stopwatch.h>
#include <blah/math/vec2.h>
#include <blah/math/vec4.h>
#include <blah/streams/bufferstream.h>
#include <blah/streams/filestream.h>
#include <blah/streams/memorystream.h>
#include <blah/streams/stream.h>
#include <blah/streams/endian.h>

View File

@ -1,11 +1,11 @@
#include <blah/app.h> #include <blah/core/app.h>
#include <blah/log.h> #include <blah/core/log.h>
#include <blah/time.h> #include <blah/core/time.h>
#include <blah/math/point.h> #include <blah/math/point.h>
#include <blah/graphics/framebuffer.h>
#include <blah/internal/platform_backend.h> #include "../internal/platform_backend.h"
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
#include <blah/internal/input_backend.h> #include "../internal/input_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#include <blah/filesystem.h> #include <blah/core/filesystem.h>
#include <blah/internal/platform_backend.h> #include "../internal/platform_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#include <blah/log.h> #include <blah/core/log.h>
#include <blah/app.h> #include <blah/core/app.h>
#include <stdarg.h> // for logging methods #include <stdarg.h> // for logging methods
#include <stdio.h> // for sprintf #include <stdio.h> // for sprintf

View File

@ -1,4 +1,4 @@
#include <blah/time.h> #include <blah/core/time.h>
#include <math.h> #include <math.h>
using namespace Blah; using namespace Blah;

View File

@ -5,7 +5,7 @@
#include <blah/graphics/shader.h> #include <blah/graphics/shader.h>
#include <blah/graphics/material.h> #include <blah/graphics/material.h>
#include <blah/math/calc.h> #include <blah/math/calc.h>
#include <blah/app.h> #include <blah/core/app.h>
using namespace Blah; using namespace Blah;
namespace namespace

View File

@ -1,7 +1,7 @@
#include <blah/drawing/spritefont.h> #include <blah/drawing/spritefont.h>
#include <blah/images/font.h> #include <blah/images/font.h>
#include <blah/images/packer.h> #include <blah/images/packer.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#include <blah/graphics/framebuffer.h> #include <blah/graphics/framebuffer.h>
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#include <blah/graphics/material.h> #include <blah/graphics/material.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#include "mesh.h" #include <blah/graphics/mesh.h>
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,6 +1,6 @@
#include <blah/graphics/renderpass.h> #include <blah/graphics/renderpass.h>
#include <blah/internal/graphics_backend.h> #include <blah/core/log.h>
#include <blah/log.h> #include "../internal/graphics_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,6 @@
#include <blah/graphics/shader.h> #include <blah/graphics/shader.h>
#include <blah/internal/graphics_backend.h> #include <blah/core/app.h>
#include "../internal/graphics_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,8 +1,8 @@
#include <blah/graphics/texture.h> #include <blah/graphics/texture.h>
#include <blah/images/image.h> #include <blah/images/image.h>
#include <blah/streams/stream.h> #include <blah/streams/stream.h>
#include <blah/internal/graphics_backend.h> #include <blah/core/log.h>
#include <blah/log.h> #include "../internal/graphics_backend.h"
using namespace Blah; using namespace Blah;

View File

@ -1,10 +1,11 @@
#include <blah/images/aseprite.h> #include <blah/images/aseprite.h>
#include <blah/streams/filestream.h> #include <blah/streams/filestream.h>
#include <blah/log.h> #include <blah/core/filesystem.h>
#include <blah/core/log.h>
#define STBI_NO_STDIO #define STBI_NO_STDIO
#define STBI_ONLY_ZLIB #define STBI_ONLY_ZLIB
#include <blah/third_party/stb_image.h> #include "../third_party/stb_image.h"
#define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))

View File

@ -1,13 +1,13 @@
#include <blah/images/font.h> #include <blah/images/font.h>
#include <blah/streams/filestream.h> #include <blah/streams/filestream.h>
#include <blah/math/calc.h> #include <blah/math/calc.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;
#define STBTT_STATIC #define STBTT_STATIC
#define STB_TRUETYPE_IMPLEMENTATION #define STB_TRUETYPE_IMPLEMENTATION
#include <blah/third_party/stb_truetype.h> #include "../third_party/stb_truetype.h"
String GetName(stbtt_fontinfo* font, int nameId) String GetName(stbtt_fontinfo* font, int nameId)
{ {

View File

@ -1,7 +1,7 @@
#include <blah/images/image.h> #include <blah/images/image.h>
#include <blah/streams/stream.h> #include <blah/streams/stream.h>
#include <blah/streams/filestream.h> #include <blah/streams/filestream.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;
@ -9,10 +9,10 @@ using namespace Blah;
#define STBI_ONLY_JPEG #define STBI_ONLY_JPEG
#define STBI_ONLY_PNG #define STBI_ONLY_PNG
#define STBI_ONLY_BMP #define STBI_ONLY_BMP
#include <blah/third_party/stb_image.h> #include "../third_party/stb_image.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION
#include <blah/third_party/stb_image_write.h> #include "../third_party/stb_image_write.h"
namespace namespace
{ {

View File

@ -1,5 +1,5 @@
#include <blah/images/packer.h> #include <blah/images/packer.h>
#include <blah/log.h> #include <blah/core/log.h>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>

View File

@ -1,9 +1,9 @@
#include <blah/input/input.h> #include <blah/input/input.h>
#include <blah/app.h> #include <blah/core/app.h>
#include <blah/time.h> #include <blah/core/time.h>
#include <blah/log.h> #include <blah/core/log.h>
#include <blah/math/point.h> #include <blah/math/point.h>
#include <blah/internal/input_backend.h> #include "../internal/input_backend.h"
#include <string.h> #include <string.h>
using namespace Blah; using namespace Blah;
@ -334,7 +334,7 @@ float Input::axis_check(int controllerIndex, Axis axis)
return 0; return 0;
} }
int Input::axis_check(int prev, Key negative, Key positive) int Input::axis_check(int fallback, Key negative, Key positive)
{ {
if (Input::pressed(positive)) if (Input::pressed(positive))
return 1; return 1;
@ -346,7 +346,7 @@ int Input::axis_check(int prev, Key negative, Key positive)
bool neg = Input::down(negative); bool neg = Input::down(negative);
if (pos && neg) if (pos && neg)
return prev; return fallback;
else if (pos) else if (pos)
return 1; return 1;
else if (neg) else if (neg)
@ -356,7 +356,7 @@ int Input::axis_check(int prev, Key negative, Key positive)
} }
} }
int Input::axis_check(int prev, int controllerIndex, Button negative, Button positive) int Input::axis_check(int fallback, int controllerIndex, Button negative, Button positive)
{ {
if (Input::pressed(controllerIndex, positive)) if (Input::pressed(controllerIndex, positive))
return 1; return 1;
@ -368,7 +368,7 @@ int Input::axis_check(int prev, int controllerIndex, Button negative, Button pos
bool neg = Input::down(controllerIndex, negative); bool neg = Input::down(controllerIndex, negative);
if (pos && neg) if (pos && neg)
return prev; return fallback;
else if (pos) else if (pos)
return 1; return 1;
else if (neg) else if (neg)

View File

@ -1,6 +1,6 @@
#include <blah/input/virtual_axis.h> #include <blah/input/virtual_axis.h>
#include <blah/time.h> #include <blah/core/time.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;

View File

@ -1,6 +1,6 @@
#include <blah/input/virtual_button.h> #include <blah/input/virtual_button.h>
#include <blah/time.h> #include <blah/core/time.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;

View File

@ -1,6 +1,6 @@
#include <blah/input/virtual_stick.h> #include <blah/input/virtual_stick.h>
#include <blah/time.h> #include <blah/core/time.h>
#include <blah/log.h> #include <blah/core/log.h>
using namespace Blah; using namespace Blah;

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <blah/app.h> #include <blah/core/app.h>
#include <blah/graphics/renderpass.h> #include <blah/graphics/renderpass.h>
#include <blah/graphics/texture.h> #include <blah/graphics/texture.h>
#include <blah/graphics/framebuffer.h> #include <blah/graphics/framebuffer.h>

View File

@ -3,10 +3,9 @@
// TODO: // TODO:
// Note the D3D11 Implementation is still a work-in-progress // Note the D3D11 Implementation is still a work-in-progress
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
#include <blah/internal/platform_backend.h> #include "../internal/platform_backend.h"
#include <blah/log.h> #include <blah/core/log.h>
#include <blah/app.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>

View File

@ -1,6 +1,8 @@
#if !(defined(BLAH_USE_OPENGL) || defined(BLAH_USE_D3D11)) #if !(defined(BLAH_USE_OPENGL) || defined(BLAH_USE_D3D11))
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
#include "../internal/platform_backend.h"
#include <blah/core/log.h>
namespace Blah namespace Blah
{ {

View File

@ -1,9 +1,8 @@
#ifdef BLAH_USE_OPENGL #ifdef BLAH_USE_OPENGL
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
#include <blah/internal/platform_backend.h> #include "../internal/platform_backend.h"
#include <blah/log.h> #include <blah/core/log.h>
#include <blah/app.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include <inttypes.h> #include <inttypes.h>
#include <blah/filesystem.h> #include <blah/core/filesystem.h>
#include <blah/containers/vector.h> #include <blah/containers/vector.h>
namespace Blah namespace Blah

View File

@ -1,12 +1,12 @@
#ifdef BLAH_USE_SDL2 #ifdef BLAH_USE_SDL2
#include <blah/internal/platform_backend.h> #include "../internal/platform_backend.h"
#include <blah/internal/input_backend.h> #include "../internal/input_backend.h"
#include <blah/internal/graphics_backend.h> #include "../internal/graphics_backend.h"
#include <blah/input/input.h> #include <blah/input/input.h>
#include <blah/app.h> #include <blah/core/app.h>
#include <blah/filesystem.h> #include <blah/core/filesystem.h>
#include <blah/log.h> #include <blah/core/log.h>
#include <SDL.h> #include <SDL.h>
#include <SDL_vulkan.h> #include <SDL_vulkan.h>

View File

@ -1,6 +1,6 @@
#include <blah/streams/filestream.h> #include <blah/streams/filestream.h>
#include <blah/internal/platform_backend.h> #include <blah/core/log.h>
#include <blah/log.h> #include "../internal/platform_backend.h"
#include <string.h> #include <string.h>
using namespace Blah; using namespace Blah;