This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Language: Cpp | |
# BasedOnStyle: WebKit | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: DontAlign | |
AlignArrayOfStructures: None | |
AlignConsecutiveMacros: None | |
AlignConsecutiveAssignments: None | |
AlignConsecutiveBitFields: None | |
AlignConsecutiveDeclarations: None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <box2d/box2d.h> | |
#include <iostream> | |
int main() | |
{ | |
b2Vec2 gravity(0.f, -9.8f); | |
b2World* world = new b2World(gravity); | |
float gx = world->GetGravity().x; | |
float gy = world->GetGravity().y; | |
std::cout << "gravity = (" << gx << ", " << gy << ")" << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import pygame | |
from Box2D import b2Draw | |
class DebugDrawer(b2Draw): | |
def __init__(self, window, pixelsPerMeter, thickness=3): | |
super().__init__() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\libs\Chipmunk2D-Chipmunk-7.0.3>emcmake cmake -G "MinGW Makefiles" -S . -B dist -DCMAKE_INSTALL_PREFIX=E:/libs/chipmunk-7.0.3-prefix/web | |
configure: cmake -G "MinGW Makefiles" -S . -B dist -DCMAKE_INSTALL_PREFIX=E:/libs/chipmunk-7.0.3-prefix/web -DCMAKE_TOOLCHAIN_FILE=C:\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=C:/emsdk/node/20.18.0_64bit/bin/node.exe | |
Configuring Chipmunk2D version 7.0.3 | |
CMake Warning (dev) at src/CMakeLists.txt:15 (add_library): | |
ADD_LIBRARY called with SHARED option but the target platform does not | |
support dynamic linking. Building a STATIC library instead. This may lead | |
to problems. | |
This warning is for project developers. Use -Wno-dev to suppress it. | |
-- Configuring done (4.4s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This example code $WHAT_IT_DOES. | |
* | |
* This code is public domain. Feel free to use it for any purpose! | |
*/ | |
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */ | |
#include <SDL3/SDL.h> | |
#include <SDL3/SDL_main.h> | |
#include <SDL3_mixer/SDL_mixer.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SDL_MAIN_USE_CALLBACKS 1 // Use callbacks instead of main() | |
#include <SDL3/SDL.h> | |
#include <SDL3/SDL_main.h> | |
#include <box2d/box2d.h> | |
#include <math.h> | |
static SDL_Window *window = NULL; | |
static SDL_Renderer *renderer = NULL; | |
b2WorldId worldId; // Physical world identifier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E:\Temp\qt-creator-14.0.2\build>cmake --build . -j4 | |
[ 0%] [ 0%] Automatic MOC and UIC for target QtCreatorPchGuiAutomatic MOC and UIC for target 3rd_cplusplus | |
[ 0%] Automatic MOC and UIC for target QtCreatorPchConsole[ 0%] | |
Copy data/syntax/ into build directory | |
[ 0%] Built target QtCreatorPchGui_autogen | |
[ 0%] Built target QtCreatorPchConsole_autogen | |
[ 0%] Built target copy_generic_highligher_to_builddir | |
[ 0%] Built target 3rd_cplusplus_autogen | |
[ 0%] Automatic MOC and UIC for target libvterm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "debug_drawer.h" | |
DebugDrawer::DebugDrawer(GLuint program, btDynamicsWorld *world, | |
const glm::mat4 &projViewMatrix, float thickness) | |
: m_world(world) | |
, m_thickness(thickness) | |
{ | |
m_lineDrawer = new LineDrawer(program, projViewMatrix); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include "line_drawer.h" | |
#include "math_helper.h" | |
#include <iostream> | |
LineDrawer::LineDrawer(GLuint program, const glm::mat4 &projViewMatrix) | |
: m_program(program) | |
, m_projViewMatrix(projViewMatrix) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mkdir dist\win | |
# cmake -G "MinGW Makefiles" -S . -B dist/win -DSDL3_DIR=E:/libs/sdl3-desktop-prefix/lib/cmake/SDL3 | |
# cmake -G "MinGW Makefiles" -S . -B dist/win -DSDL3_DIR=E:/libs/sdl3-libs/SDL3-devel-3.1.3-mingw/SDL3-3.1.3/x86_64-w64-mingw32/lib/cmake/SDL3 | |
# cd dist/win | |
# mingw32-make | |
# app | |
cmake_minimum_required(VERSION 3.20) | |
project(background_color_opengl_sdl3_cpp) |
NewerOlder