From 6a7789ff77026b5d36576e04e4a41daecf630968 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 9 Jan 2022 19:33:34 +0800 Subject: [PATCH] - enhancement: add raylib to autolinks - enhancement: distribute raylib with integrated gcc --- NEWS.md | 2 + RedPandaIDE/resources/autolink.json | 2 +- templates/raylib.ico | Bin 0 -> 4286 bytes templates/raylib.template | 20 +++++++ templates/raylib_c.txt | 78 ++++++++++++++++++++++++++++ 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 templates/raylib.ico create mode 100644 templates/raylib.template create mode 100644 templates/raylib_c.txt diff --git a/NEWS.md b/NEWS.md index 8f251a73..25d7f3cd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ Red Panda C++ Version 0.13.1 - fix: .rc file shouldn't be syntax checked - enhancement: auto save/restore size of the new project dialog - fix: new project dialog's tab bar should fill all empty spaces + - enhancement: add raylib to autolinks + - enhancement: distribute raylib with integrated gcc Red Panda C++ Version 0.12.7 - change: make current build system follow FHS specifications diff --git a/RedPandaIDE/resources/autolink.json b/RedPandaIDE/resources/autolink.json index 1ffd73d3..279f42c0 100644 --- a/RedPandaIDE/resources/autolink.json +++ b/RedPandaIDE/resources/autolink.json @@ -29,7 +29,7 @@ }, { "header": "raylib.h", - "links": "-lraylib -lglfw3 -lopengl32 -lgdi32 -lopenal -lwinmm" + "links": "-lraylib -lopengl32 -lgdi32 -lwinmm" }, { "header": "turtle.h", diff --git a/templates/raylib.ico b/templates/raylib.ico new file mode 100644 index 0000000000000000000000000000000000000000..b6d9382546c7c4ffeb30d2a010ed5b8955c7c540 GIT binary patch literal 4286 zcmchbhgXzW8phebVApJnCKNR`>;j7PCMrddDhy4Eh#-hjumuyNMoG+OH7hBAC`g9^ zDQXZjcFdY+6p0;sELoLkM24B+x9>M*+$?L3IVb1r9qxQHcV_PM-sgSZ@?m1~CwUAU zXrerul>NoTdM&pf-h`fR zG&=dc%uanL?=+_oR^`E>+GzHi-@(Jq`*d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1_16iivR!s literal 0 HcmV?d00001 diff --git a/templates/raylib.template b/templates/raylib.template new file mode 100644 index 00000000..da601203 --- /dev/null +++ b/templates/raylib.template @@ -0,0 +1,20 @@ +[Template] +ver=2 +Name=raylib +Name[zh_CN]=raylib +Icon=CL_Turtle.ico +Description=A simple program using raylib ( https://raylib.com ) +Description[zh_CN]=简单的raylib程序 ( https://raylib.com ) +Category=Multimedia +Category[zh_CN]=多媒体 + +[Unit0] +CName=main.c +C=raylib_c.txt + +[Project] +UnitCount=1 +Type=0 +IsCpp=0 +linker=-lraylib -lopengl32 -lgdi32 -lwinmm_@@__@@_ + diff --git a/templates/raylib_c.txt b/templates/raylib_c.txt new file mode 100644 index 00000000..a1a44df2 --- /dev/null +++ b/templates/raylib_c.txt @@ -0,0 +1,78 @@ +/******************************************************************************************* + * + * raylib [shapes] example - Draw basic shapes 2d (rectangle, circle, line...) + * + * This example has been created using raylib 1.0 (www.raylib.com) + * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) + * + * Copyright (c) 2014 Ramon Santamaria (@raysan5) + * + ********************************************************************************************/ + +#include + +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [shapes] example - basic shapes drawing"); + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + // TODO: Update your variables here + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + DrawText("some basic shapes available on raylib", 20, 20, 20, DARKGRAY); + + // Circle shapes and lines + DrawCircle(screenWidth/5, 120, 35, DARKBLUE); + DrawCircleGradient(screenWidth/5, 220, 60, GREEN, SKYBLUE); + DrawCircleLines(screenWidth/5, 340, 80, DARKBLUE); + + // Rectangle shapes and ines + DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED); + DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD); + DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines + + // Triangle shapes and lines + DrawTriangle((Vector2){screenWidth/4.0f *3.0f, 80.0f}, + (Vector2){screenWidth/4.0f *3.0f - 60.0f, 150.0f}, + (Vector2){screenWidth/4.0f *3.0f + 60.0f, 150.0f}, VIOLET); + + DrawTriangleLines((Vector2){screenWidth/4.0f*3.0f, 160.0f}, + (Vector2){screenWidth/4.0f*3.0f - 20.0f, 230.0f}, + (Vector2){screenWidth/4.0f*3.0f + 20.0f, 230.0f}, DARKBLUE); + + // Polygon shapes and lines + DrawPoly((Vector2){screenWidth/4.0f*3, 320}, 6, 80, 0, BROWN); + DrawPolyLinesEx((Vector2){screenWidth/4.0f*3, 320}, 6, 80, 0, 6, BEIGE); + + // NOTE: We draw all LINES based shapes together to optimize internal drawing, + // this way, all LINES are rendered in a single draw pass + DrawLine(18, 42, screenWidth - 18, 42, BLACK); + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} \ No newline at end of file