mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-04 17:17:35 +00:00
@@ -4,7 +4,7 @@ if (NOT raylib_FOUND)
|
||||
FetchContent_Declare(
|
||||
raylib
|
||||
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
||||
GIT_TAG dec5f332ad9467d778c188be24169428907df0be
|
||||
GIT_TAG c3386300d34f77442beefcf7bfb857718e5c74fe
|
||||
)
|
||||
FetchContent_GetProperties(raylib)
|
||||
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||
|
||||
@@ -31,13 +31,13 @@ int main(void)
|
||||
raylib::Font font2("resources/custom_alagard.png"); // Font loading
|
||||
raylib::Font font3("resources/custom_jupiter_crash.png"); // Font loading
|
||||
|
||||
raylib::Vector2 fontPosition1(screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2,
|
||||
raylib::Vector2 fontPosition1(screenWidth/2 - MeasureTextEx(font1, msg1.c_str(), font1.baseSize, -3).x/2,
|
||||
screenHeight/2 - font1.baseSize/2 - 80);
|
||||
|
||||
raylib::Vector2 fontPosition2(screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2,
|
||||
raylib::Vector2 fontPosition2(screenWidth/2 - MeasureTextEx(font2, msg2.c_str(), font2.baseSize, -2).x/2,
|
||||
screenHeight/2 - font2.baseSize/2 - 10);
|
||||
|
||||
raylib::Vector2 fontPosition3(screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2,
|
||||
raylib::Vector2 fontPosition3(screenWidth/2 - MeasureTextEx(font3, msg3.c_str(), font3.baseSize, 2).x/2,
|
||||
screenHeight/2 - font3.baseSize/2 + 50);
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
@@ -87,6 +87,10 @@ namespace raylib {
|
||||
void Unload() {
|
||||
UnloadTexture(*this);
|
||||
};
|
||||
|
||||
void SetMaterialTexture(Material *material, int mapType) {
|
||||
::SetMaterialTexture(material, mapType, *this);
|
||||
}
|
||||
};
|
||||
typedef Texture2D Texture;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ namespace raylib {
|
||||
void DrawLine3D(::Vector3 endPos, ::Color color) {
|
||||
::DrawLine3D(*this, endPos, color);
|
||||
}
|
||||
void DrawPoint3D(::Color color) {
|
||||
::DrawPoint3D(*this, color);
|
||||
}
|
||||
void DrawCircle3D(float radius, Vector3 rotationAxis, float rotationAngle, Color color) {
|
||||
::DrawCircle3D(*this, radius, rotationAxis, rotationAngle, color);
|
||||
}
|
||||
|
||||
void DrawCube(float width, float height, float length, ::Color color) {
|
||||
::DrawCube(*this, width, height, length, color);
|
||||
@@ -61,6 +67,26 @@ namespace raylib {
|
||||
::DrawCubeTexture(texture, *this, width, height, length, color);
|
||||
}
|
||||
|
||||
void DrawSphere(float radius, Color color) {
|
||||
::DrawSphere(*this, radius, color);
|
||||
}
|
||||
|
||||
void DrawSphere(float radius, int rings, int slices, Color color) {
|
||||
::DrawSphereEx(*this, radius, rings, slices, color);
|
||||
}
|
||||
|
||||
void DrawSphereWires(float radius, int rings, int slices, Color color) {
|
||||
::DrawSphereWires(*this, radius, rings, slices, color);
|
||||
}
|
||||
|
||||
void DrawCylinder(float radiusTop, float radiusBottom, float height, int slices, Color color) {
|
||||
::DrawCylinder(*this, radiusTop, radiusBottom, height, slices, color);
|
||||
}
|
||||
|
||||
void DrawCylinderWires(float radiusTop, float radiusBottom, float height, int slices, Color color) {
|
||||
::DrawCylinderWires(*this, radiusTop, radiusBottom, height, slices, color);
|
||||
}
|
||||
|
||||
void DrawPlane(::Vector2 size, ::Color color) {
|
||||
::DrawPlane(*this, size, color);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ if (NOT raylib_FOUND)
|
||||
FetchContent_Declare(
|
||||
raylib
|
||||
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
||||
GIT_TAG 6f2f09947f5456cefb3d91d3f667f4d72fa55be6
|
||||
GIT_TAG c3386300d34f77442beefcf7bfb857718e5c74fe
|
||||
)
|
||||
FetchContent_GetProperties(raylib)
|
||||
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||
@@ -26,7 +26,7 @@ if (NOT raylib-cpp_FOUND)
|
||||
FetchContent_Declare(
|
||||
raylib-cpp
|
||||
GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp.git
|
||||
GIT_TAG cfa1c3715c0fbf20d9a7d7f66fc4f128216b57e4
|
||||
GIT_TAG ebfce48b9e9bb3df31083c11b4f30f0f7c6743c1
|
||||
)
|
||||
FetchContent_GetProperties(raylib-cpp)
|
||||
if (NOT raylib-cpp_POPULATED) # Have we downloaded raylib yet?
|
||||
|
||||
Reference in New Issue
Block a user