Skip to content

Commit

Permalink
Merge pull request #2 from ufrshubham/cmake_support
Browse files Browse the repository at this point in the history
Added cmake support
  • Loading branch information
ufrshubham authored Oct 3, 2020
2 parents 2a9c1e9 + 405e745 commit 6704a93
Show file tree
Hide file tree
Showing 156 changed files with 32,423 additions and 273 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,6 @@ FodyWeavers.xsd

# Local History for Visual Studio Code
.history/

# cmake
build/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.0.0)
project(Brick-Buster VERSION 0.1.0)

# Makes sure custom settings from incldue/b2_user_settings.h are used by box2d.
add_compile_definitions(B2_USER_SETTINGS)

add_subdirectory(src)

# Copies assets and its contents to build directory.
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})
31 changes: 0 additions & 31 deletions TheGame.sln

This file was deleted.

172 changes: 0 additions & 172 deletions TheGame.vcxproj

This file was deleted.

69 changes: 0 additions & 69 deletions TheGame.vcxproj.filters

This file was deleted.

72 changes: 72 additions & 0 deletions include/b2_user_settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#pragma once

#include <SFML/Graphics/Shape.hpp>

#include <stdarg.h>
#include <stdint.h>

// Tunable Constants

/// You can use this to change the length scale used by your game.
/// For example for inches you could use 39.4.
#define b2_lengthUnitsPerMeter 1.0f

/// The maximum number of vertices on a convex polygon. You cannot increase
/// this too much because b2BlockAllocator has a maximum object size.
#define b2_maxPolygonVertices 8

using b2BodyUserData = sf::Shape*;

/// You can define this to inject whatever data you want in b2Fixture
struct b2FixtureUserData
{
b2FixtureUserData()
{
pointer = 0;
}

/// For legacy compatibility
uintptr_t pointer;
};

/// You can define this to inject whatever data you want in b2Joint
struct b2JointUserData
{
b2JointUserData()
{
pointer = 0;
}

/// For legacy compatibility
uintptr_t pointer;
};

// Memory Allocation

/// Default allocation functions
void* b2Alloc_Default(int32 size);
void b2Free_Default(void* mem);

/// Implement this function to use your own memory allocator.
inline void* b2Alloc(int32 size)
{
return b2Alloc_Default(size);
}

/// If you implement b2Alloc, you should also implement this function.
inline void b2Free(void* mem)
{
b2Free_Default(mem);
}

/// Default logging function
void b2Log_Default(const char* string, va_list args);

/// Implement this to use your own logging.
inline void b2Log(const char* string, ...)
{
va_list args;
va_start(args, string);
b2Log_Default(string, args);
va_end(args);
}
Loading

0 comments on commit 6704a93

Please sign in to comment.