diff options
| author | Richard Smith <[email protected]> | 2021-10-19 18:50:21 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-19 19:50:21 +0200 |
| commit | 8e599908d9cca8f2f96f53790837f49abcea2745 (patch) | |
| tree | 9addabc417d165264f0cd72bb35d1ccac5a26ca4 /projects/CodeBlocks | |
| parent | ae7127232d720e1d8584ea0266eae98d5a543133 (diff) | |
| download | raylib-8e599908d9cca8f2f96f53790837f49abcea2745.tar.gz raylib-8e599908d9cca8f2f96f53790837f49abcea2745.zip | |
Re-write Code::Blocks template to work on Linux and Macos (#2073)
* update code::blocks example to support linux
* add macos support
* update screenshot
* update templates readme
Diffstat (limited to 'projects/CodeBlocks')
| -rw-r--r-- | projects/CodeBlocks/README.md | 35 | ||||
| -rwxr-xr-x[-rw-r--r--] | projects/CodeBlocks/compiler_settings.png | bin | 71748 -> 53305 bytes | |||
| -rw-r--r-- | projects/CodeBlocks/core_basic_window.c | 6 | ||||
| -rw-r--r-- | projects/CodeBlocks/core_basic_window.cbp | 121 |
4 files changed, 123 insertions, 39 deletions
diff --git a/projects/CodeBlocks/README.md b/projects/CodeBlocks/README.md index 0e4db919..fb072ba8 100644 --- a/projects/CodeBlocks/README.md +++ b/projects/CodeBlocks/README.md @@ -1,16 +1,19 @@ -# raylib for Code::Blocks
-**by D3nX**
-<br/>
-Hey! Here it is a project template to use with `Code::Blocks` =)
-<br/><br/>
-First, you need to download the [raylib installer](https://www.raylib.com) and run it. It will install raylib with the compiler.
-<br/><br/>
-Then, download the template, and open the project with `Code::Blocks`.
-
-Before running the template, make sure following set the raylib compiler for the IDE as show below:
-<br>
-
-<br/>
-Finally, you can run the program and enjoy raylib running on `Code::Blocks`!
-<br /><br />
-Hope it helped you =)
+# Raylib template for Code::Blocks + +1. Install Raylib. On Windows you must install the **Windows Installer (with MinGW compiler)** package. On other +platforms you can install however you like following the instructions in the wiki. + * https://github.com/raysan5/raylib/releases/download/3.7.0/raylib_installer_v370.mingw.exe + * https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux + * https://github.com/raysan5/raylib/wiki/Working-on-macOS + +2. Install and run Code::Blocks. + +3. **Windows only**: Select `Settings` `Compiler` `Toolchain executables`. +Change `Compiler's instrallation directory` to `C:\raylib\MingGW`. Do *not* press auto-detect. There is a screenshot +below showing how it should look. Press `OK`. + +4. Select `File` `Open` and open the `core_basic_windows.cbp` file. + + + +For an example with resources, see https://github.com/electronstudio/raylib-game-template-codeblocks
\ No newline at end of file diff --git a/projects/CodeBlocks/compiler_settings.png b/projects/CodeBlocks/compiler_settings.png Binary files differindex 67f9b7a1..f87574d9 100644..100755 --- a/projects/CodeBlocks/compiler_settings.png +++ b/projects/CodeBlocks/compiler_settings.png diff --git a/projects/CodeBlocks/core_basic_window.c b/projects/CodeBlocks/core_basic_window.c index 588f80c2..da5b2e01 100644 --- a/projects/CodeBlocks/core_basic_window.c +++ b/projects/CodeBlocks/core_basic_window.c @@ -1,12 +1,8 @@ -/*******************************************************************************************-lraylib -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -* +/******************************************************************************************* * raylib [core] example - Basic window * * Welcome to raylib! * -* To test examples, just press F6 and execute raylib_compile_execute script -* Note that compiled executable is placed in the same folder as .c file -* * You can find all basic examples on C:\raylib\raylib\examples folder or * raylib official webpage: www.raylib.com * diff --git a/projects/CodeBlocks/core_basic_window.cbp b/projects/CodeBlocks/core_basic_window.cbp index c4b22a9e..ab9fe58a 100644 --- a/projects/CodeBlocks/core_basic_window.cbp +++ b/projects/CodeBlocks/core_basic_window.cbp @@ -2,51 +2,136 @@ <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> - <Option title="core_basic_window" /> + <Option title="raylib-game-template" /> + <Option execution_dir="." /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> - <Target title="Debug"> - <Option output="bin/Debug/core_basic_window" prefix_auto="1" extension_auto="1" /> + <Target title="Debug (Mac)"> + <Option platforms="Mac;" /> + <Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> <Option object_output="obj/Debug/" /> <Option type="1" /> <Option compiler="gcc" /> <Compiler> <Add option="-g" /> - <Add directory="../../src" /> </Compiler> <Linker> - <Add option="-lraylib -lopengl32 -lgdi32 -lwinmm" /> - <Add library="../../src/libraylib.a" /> + <Add library="raylib" /> + <Add option="-framework OpenGL" /> + <Add option="-framework Cocoa" /> + <Add option="-framework IOKit" /> + <Add option="-framework CoreAudio" /> + <Add option="-framework CoreVideo" /> </Linker> </Target> - <Target title="Release"> - <Option output="bin/Release/core_basic_window" prefix_auto="1" extension_auto="1" /> + <Target title="Release (Mac)"> + <Option platforms="Mac;" /> + <Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> <Option object_output="obj/Release/" /> <Option type="1" /> <Option compiler="gcc" /> <Compiler> <Add option="-O2" /> - <Add directory="../../src" /> </Compiler> <Linker> <Add option="-s" /> - <Add option="-lraylib -lopengl32 -lgdi32 -lwinmm" /> - <Add library="../../src/libraylib.a" /> + <Add library="raylib" /> + <Add option="-framework OpenGL" /> + <Add option="-framework Cocoa" /> + <Add option="-framework IOKit" /> + <Add option="-framework CoreAudio" /> + <Add option="-framework CoreVideo" /> + </Linker> + </Target> + <Target title="Debug (Linux)"> + <Option platforms="Unix;" /> + <Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> + <Option object_output="obj/Debug/" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add library="raylib" /> + <Add library="GL" /> + <Add library="m" /> + <Add library="pthread" /> + <Add library="dl" /> + <Add library="rt" /> + <Add library="X11" /> + </Linker> + </Target> + <Target title="Release (Linux)"> + <Option platforms="Unix;" /> + <Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> + <Option object_output="obj/Release/" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add library="raylib" /> + <Add library="GL" /> + <Add library="m" /> + <Add library="pthread" /> + <Add library="dl" /> + <Add library="rt" /> + <Add library="X11" /> + </Linker> + </Target> + <Target title="Debug (Windows)"> + <Option platforms="Windows;" /> + <Option output="bin/Debug/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> + <Option object_output="obj/Debug/" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-g" /> + </Compiler> + <Linker> + <Add library="raylib" /> + <Add library="opengl32" /> + <Add library="gdi32" /> + <Add library="winmm" /> + <Add option="-static" /> + <Add library="pthread" /> + </Linker> + </Target> + <Target title="Release (Windows)"> + <Option platforms="Windows;" /> + <Option output="bin/Release/raylib-game-template" prefix_auto="1" extension_auto="1" /> + <Option working_dir="." /> + <Option object_output="obj/Release/" /> + <Option type="1" /> + <Option compiler="gcc" /> + <Compiler> + <Add option="-O2" /> + </Compiler> + <Linker> + <Add option="-s" /> + <Add library="raylib" /> + <Add library="opengl32" /> + <Add library="gdi32" /> + <Add library="winmm" /> + <Add option="-static" /> + <Add library="pthread" /> </Linker> </Target> </Build> <Compiler> - <Add option="-Wall -std=c99" /> + <Add option="-Wall" /> </Compiler> <Unit filename="core_basic_window.c"> <Option compilerVar="CC" /> </Unit> - <Extensions> - <code_completion /> - <envvars /> - <debugger /> - <lib_finder disable_auto="1" /> - </Extensions> </Project> </CodeBlocks_project_file> |
