Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
翻译准备中
最可爱的框架,用于在 C++ 中创建 2D 和 3D 游戏!
AI 翻译
The *cutest* framework out there for creating 2D and 3D games in C++!
游戏C · C++GitHub @RandyGaul自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
安装型项目无需部署域名也可验证。个人仓库可通过 GitHub 登录验证,组织仓库可使用上方的仓库验证文件。
正在加载完整 README。 以下为已保存的摘录。
Cute Framework (CF) is the cutest framework available for making 2D and 3D games in C++. It provides a portable foundational layer for building games in C/C++ without baggage, gnarly dependencies, or cryptic APIs. CF runs almost anywhere, including Windows, MacOS, iOS, Android, Linux, Browsers, and more!
Cute Framework is designed to be built from source. You can link your project against CF as either a static or shared library. Be sure to visit the Cute Framework documentation site for more in-depth details and steps.
Creating a window and closing it.查看完整 README ↗Cute Framework (CF) is the cutest framework available for making 2D and 3D games in C++. It provides a portable foundational layer for building games in C/C++ without baggage, gnarly dependencies, or cryptic APIs. CF runs almost anywhere, including Windows, MacOS, iOS, Android, Linux, Browsers, and more!
Cute Framework is designed to be built from source. You can link your project against CF as either a static or shared library. Be sure to visit the Cute Framework documentation site for more in-depth details and steps.
Creating a window and closing it.
#include <cute.h>
using namespace Cute;
int main(int argc, char* argv[])
{
// Create a window with a resolution of 640 x 480.
CF_Result result = make_app("Fancy Window Title", 0, 0, 0, 640, 480, CF_APP_OPTIONS_WINDOW_POS_CENTERED_BIT, argv[0]);
if (is_error(result)) return -1;
while (app_is_running())
{
app_update();
// All your game logic and updates go here...
app_draw_onto_screen();
}
destroy_app();
return 0;
}
Building CF should be done with CMake. The reason CMake is chosen, is it's one of the only working cross-platform build generators in existence, that actually works pretty much everywhere. Make sure you have a compiler installed that you're familiar with beforehand. If you're new to C/C++ I highly recommend using Microsoft Visual Studio (Community Edition), for Windows users. If you don't like Visual Studio you can try gcc/g++ (MinGW), tdm-gcc is recommended in this case. Alternatively if you're on an older OS such as Windows 8, you can use w64devkit which should also work. If you're MacOS, XCode (and the command line tools) are recommended. For Linux you'll probably use g++.
It's highly recommended to use CF's Cmake project template and follow along these steps with it!
src in the top-level of your project, and place your initial main.cpp there.Note For Linux users make sure to you have Vulkan, gcc/g++, etc. installed and setup. You can try these commands:
sudo apt-get update -qq
sudo apt-get install build-essential gcc-multilib cmake
sudo apt-get install libasound2-dev libpulse-dev
sudo apt-get install -y --no-install-recommends libvulkan-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
Note On WSL2 you may also need
sudo apt install libpulse0.
The documentation website is the go-to place for finding all the resources available. Here are some quick-links to get you started:
If you're stuck and need help then check out the Discord chat. Feel free to pop in and ask questions, make suggestions, or have a discussion. General gamedev chatting unrelated to CF is also welcome!
Feel free to open up an issue right here on GitHub to ask any questions. If you'd like to make a pull request I highly recommend opening a GitHub issue first to start a discussion on any changes you would like to make.
The main ways to contribute to CF are:
Read on below for instructions on each style of contribution. If you wish to add in new features to CF please open a GitHub issue to discuss the proposal first, to avoid putting in effort on a PR before receiving any feedback and avoid wasted work.
Simply open up a GitHub issue for reporting bugs. Be sure to describe as much detail as you can to understand or debug the problem.
For bug fixes please create a GitHub pull request. Try to be careful to match CF code style, and describe your decision making and the problem involved.
The CF samples are quite easy to extend. Simply copy + paste one of the other samples to get started, such as one of the simpler ones, perhaps basic_sprite. or basic_input.c.
Open up CF's samples CmakeLists.txt file to hook up the sample to the build system. Add your new sample here like so for the example "new_sample":
...
add_sample(waves waves.cpp)
add_sample(shallow_water shallow_water.cpp)
add_sample(noise noise.c)
add_sample(new_sample new_sample.c)
If your sample needs access to files on disk, such as assets like images or audio, create a folder in CF's samples folder. Name it "new_sample_data", where "new_sample" is the name of your new sample. Then add in a line to CF's CmakeLists.txt file to copy over the assets to the build folder when building.
add_custom_command(TARGET spaceshooter PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/spaceshooter_data $<TARGET_FILE_DIR:spaceshooter>/spaceshooter_data)
add_custom_command(TARGET waves PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/waves_data $<TARGET_FILE_DIR:waves>/waves_data)
add_custom_command(TARGET shallow_water PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/shallow_water_data $<TARGET_FILE_DIR:shallow_water>/shallow_water_data)
add_custom_command(TARGET shallow_water PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/new_sample $<TARGET_FILE_DIR:shallow_water>/new_sample)
And that's it! Regenerate your project and you will be able to build your new sample. Once confirmed working as intended, open a pull request to add in your new sample!
All of CF's docs for the CF website are located here in GitHub under the docs folder. Editing any of these docs is a good way to contribute to CF through a pull-request.
Please note that the reference pages for functions/structs are automatically generated by CF's docs parser + generator. You can run this executable to regenerate all of the docs files for all of CF. If you wish to edit any of the reference pages be sure to edit the appropriate file in CF's actual source code and regenerate the docs by running docs_parser.
CF uses MkDocs with the Material theme to generate the website, so you can run mkdocs serve to preview the docs locally.
MkDocs requirements:
pip install mkdocs mkdocs-material "mkdocs-material[imaging]" markdown-callouts