Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

raylib architecture

Alan Arrecis edited this pageNov 22, 2024 ·32 revisions

image

raylib is a highly modular library. Everything is contained within a small number of well defined, specific and self-contained modules, each organized according to its primary functionality (nicely avoiding the huge tree of recursive dependencies, typical of other C libraries).

raylib hasseven main modules:

  • rcore: Window / Graphic Context / Inputs management.
  • rlgl: Graphic API (OpenGL) wrapper and pseudo-OpenGL 1.1 translation layer.
  • rtextures: Textures / Image loading and management.
  • rtext: Font data loading and text drawing.
  • rshapes: Basic 2D shapes drawing functions.
  • rmodels: 3D models loading and drawing.
  • raudio: Audio device management and sounds / music loading and playing.

Those seven modules share a common header, namedraylib.h. All API functions are defined in that header, despite being internally divided into seven modules, so the user only needs to includeraylib.h to access all of the raylib functionality. Other libraries often use a header for every module (so users can select the ones they include), but this complicates the dependencies. The simple approach that raylib adopts is just easier for novice (and expert) users.

Beyond the seven main modules that are described above, there is a small collection of additional modules that implement extra features:

  • raymath: Vector2, Vector3, Matrix and Quaternion math related functions.
  • rcamera: 3D Camera system (free, 1st person, 3rd person, custom).
  • rgestures: Touch gesture detection and processing (Tap, Swipe, Drag, Pinch).
  • raygui: Simple IMGUI system with several controls for tools development.
  • rres: Resource packaging file-format with some tools provided.

raylib extra modules are designed to be as decoupled as possible from the other modules. In fact, some modules can be used as standalone libraries, independently of raylib, including therlgl (example) andraudio (example) modules.

Most of the secondary modules (raymath,rcamera,rgestures,raygui,rres) can also be used as standalone libraries. They are distributed as configurable, single-file, header-only libraries, allowing them to be independently added to any project. Being header-only means that the file also contains function implementations. That can be extremely useful when you want to drop a library (a bunch of functions) into your codebase to provide specific functionality. However, creating a header-only module is not trivial, as the module must implement very specific functionality, while minimizing external dependencies and global variables. Simply put, it must be completely portable.

NOTE:Theraymath,rcamera andrgestures modules are all compiled with raylib by default.

raylib also uses some external libraries (most of which are included as single-file, header-only libraries), including the well knownstb libraries andsome other similar libraries.

Familiarity with the modules is essential for raylib proficiency. Refer tothe Cheatsheet for a comprehensive summary.

www.raylib.com  |  itch.io  |  GitHub  |  Discord  |  YouTube

Library Design

Development Platforms

IDE Configurations

Misc Help

Wiki History

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp