1 Star 0 Fork 0

找不到服务器 / raylib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Zlib

raylib

基于OpenGL的3D图形库。
原仓库 https://github.com/raysan5/raylib,这里根据自己的需求进行了大量修改和裁剪。

依赖库

一个简单的例子

#include "raylib.h"
int main(void) {
    Camera camera;
	SetConfigFlags(FLAG_MSAA_4X_HINT);
    SetTargetFPS(60);
    InitGraph(1024, 768, "RayLib-3D");
	InitDefaultCamera(&camera);
    Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };

    while (!WindowShouldClose()) {
        BeginDrawing();
            ClearBackground(RAYWHITE);
            BeginMode3D(camera);
                DrawGrid(120, 5);
                DrawSphere(cubePosition, 2.0f, ORANGE);
            EndMode3D();
            DrawText(TextFormat("%2i FPS", GetFPS()), 0, 0, 20, LIME);
        EndDrawing();
    }
    CloseGraph();
    return 0;
}
# CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(untitled)
set(CMAKE_BUILD_TYPE release)
add_executable(${CMAKE_PROJECT_NAME} main.cpp)
list(APPEND CMAKE_INSTALL_PREFIX "E:/cpplibraries")
find_package(raylib REQUIRED)
message(STATUS "raylib_VERSION: ${raylib_VERSION}")
message(STATUS "raylib_LIBS: ${raylib_LIBS}")
message(STATUS "raylib_INCLUDE_DIRS: ${raylib_INCLUDE_DIRS}")
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC ${raylib_LIBS})
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${raylib_INCLUDE_DIRS})
Copyright (c) 2013-2022 Ramon Santamaria (@raysan5) This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.

简介

基于OpenGL的3D图形库 展开 收起
C 等 2 种语言
Zlib
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xd15zhn/raylib.git
git@gitee.com:xd15zhn/raylib.git
xd15zhn
raylib
raylib
master

搜索帮助