P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
raylib_impl
Collaboration diagram for raylib_impl:

Namespaces

namespace  raylib

Classes

class  RayMusic
 raylib music stream. More...
class  RaySound
 Raylib Sound class - a LoadSoundAlias() of a RaySoundBuffer, does not own the buffer. Deleting the sound never touches the buffer. More...
class  RaySoundBuffer
 Raylib SoundBuffer class - owns the loaded samples (raylib's own LoadSound() result). RaySound instances are LoadSoundAlias()'d from this and don't own the samples themselves. More...
class  RayGamepad
class  RayKeyboard
 raylib keyboard, read straight off the native state queries. More...
class  RayMouse
 raylib mouse. More...
class  RayAnimationSet
 Raylib AnimationSet class - owns the loaded clips, independent of any RayModel bound to it. More...
class  RayFont
 Raylib Font class - owns the loaded font, independent of any RayText built from it. More...
class  RayMesh
 Raylib Mesh class - owns the loaded geometry (raylib's own Model struct is the mesh+material data, not positioned). Many RayModel instances can reference one RayMesh; deleting a model never touches the mesh. More...
class  RayModel
 Raylib Model class - references a RayMesh, does not own it. More...
class  RayPolygon
class  RaySprite
 Raylib Sprite class - references a RayTexture, does not own it. Deleting the sprite never touches the texture. More...
class  RayText
 Raylib Text class - references a RayFont, does not own it. Deleting the text never touches the font. More...
class  RayTexture
 Raylib Texture class - owns the GPU texture. RaySprite/RayModel only reference it, never own it: this survives as long as the caller keeps it alive, regardless of how many sprites/models get created and destroyed against it. More...
class  RayAudioModule
 L'ouverture du peripherique audio de raylib, comptee par reference. More...
class  RayGraphicModule
 Single concrete class implementing IGraphic3Module, which already IS-A IGraphic2Module via the interface chain - one createWindow()/ createSprite()/... implementation, exported under two dlsym entry points (getGraphic2Module/getGraphic3Module) in sources/raylib.cpp, both returning this same instance. More...
class  RayCamera
 Raylib Camera class. More...
class  RayWindow
 Raylib Window class - a single concrete class implementing IWindow3 fully (which already IS-A IWindow2 IS-A IWindow via the interface chain), matching raylib itself : one native window, no separate 2D/3D window objects. More...

Macros

#define RAYLIB_CPP_

Functions

IGraphic2Module * getGraphic2Module ()
 Le module graphique 2D de ce vendor.
IGraphic3Module * getGraphic3Module ()
 Le module graphique 3D de ce vendor.
IAudioModule * getAudioModule ()
 Le module audio de ce vendor.
IModule ** getModules ()
 Tout ce que cette dll fournit, sans avoir a nommer un contrat.
void RayWindow::drawPoly (graphic::IPolygon *polygon) override
 draw a polygon
void RayWindow::drawSprite (graphic::ISprite *sprite) override
 draw a sprite
void RayWindow::drawText (graphic::IText *text) override
 draw a text
void RayWindow::beginMode3 (graphic::ICamera *camera) override
 allowing to draw 3D on the window
void RayWindow::drawModel (graphic::IModel *model) override
 draw a model
void RayWindow::drawText3D (graphic::IText *text, Vector3f position) override
 draw text at a 3D world position - the same IText used by drawText(), just projected through the active camera instead of drawn at a screen-space position.
void RayWindow::endMode3 () override
 end the 3D drawing

Detailed Description

raylib_impl

version: 0.2.0

Docs

raylib 5.5 behind igraphic and iaudio.

Exports getGraphic2Module(), getGraphic3Module() and getAudioModule(). The first two hand back the same instance seen from both ends of the inheritance chain — one implementation, no risk of the two views drifting.

Two ways to take it

target artefact use
raylib_impl raylib_impl.dylib the plugin, what ModuleManager::Load() opens
raylib_impl_static libraylib_impl.a linked in, brings its include dirs and the platform frameworks

Neither follows BUILD_SHARED_LIBS : a plugin turned into a .a would fail at runtime with an obscure message. Pick by target name.

Examples

build/raylib_impl_demo_dynamic # dlopen at runtime
build/raylib_impl_demo_static # linked in, no dlopen at all

dynamic takes a dll path in argv[1], so the same binary runs any vendor :

build/raylib_impl_demo_dynamic ../../sfml_impl/build/sfml_impl.dylib ../../sfml_impl/assets

What raylib forced

  • No event queue at all, only state queries refreshed once a frame by PollInputEvents() inside EndDrawing(). IsKeyPressed compares two arrays, so nothing is consumed and every read is idempotent — this is the behaviour the contract asks for, and the one sfml was aligned on. Here pollEvent() has nothing to drain and answers true always, since raylib cannot tell whether anything happened.
  • IsMusicStreamPlaying cannot tell "paused" from "stopped", so RayMusic tracks the three states itself.
  • SeekMusicStream wraps past the end (115s on a 109s track gave 6s), so setTime clamps.
  • PlaySound overlaps by default ; the contract wants a restart.
  • No modifier mask on events : rebuilt from IsKeyDown.
  • No positional audio : setPosition stores and keeps playing.

Known limitation

UpdateModelAnimation writes the pose into the mesh's own vertex buffer, so two RayModel sharing one RayMesh cannot sit on different animation frames. Sharing position, rotation and size works.

Tests need a real screen

InitWindow segfaults inside raylib when the display is asleep or locked — GLFW finds no monitor and raylib dereferences null GL pointers. On CI, use xvfb-run.

Macro Definition Documentation

◆ RAYLIB_CPP_

#define RAYLIB_CPP_

Function Documentation

◆ beginMode3()

void RayWindow::beginMode3 ( graphic::ICamera * camera)
overridevirtual

allowing to draw 3D on the window

Parameters
camera

Implements graphic::IWindow3.

◆ drawModel()

void RayWindow::drawModel ( graphic::IModel * model)
overridevirtual

draw a model

Parameters
model

Implements graphic::IWindow3.

◆ drawPoly()

void RayWindow::drawPoly ( graphic::IPolygon * polygon)
overridevirtual

draw a polygon

Parameters
polygon

Implements graphic::IWindow2.

◆ drawSprite()

void RayWindow::drawSprite ( graphic::ISprite * sprite)
overridevirtual

draw a sprite

Parameters
sprite

Implements graphic::IWindow2.

◆ drawText()

void RayWindow::drawText ( graphic::IText * text)
overridevirtual

draw a text

Implements graphic::IWindow2.

◆ drawText3D()

void RayWindow::drawText3D ( graphic::IText * text,
Vector3f position )
overridevirtual

draw text at a 3D world position - the same IText used by drawText(), just projected through the active camera instead of drawn at a screen-space position.

Parameters
text
position

Implements graphic::IWindow3.

◆ endMode3()

void RayWindow::endMode3 ( )
overridevirtual

end the 3D drawing

Implements graphic::IWindow3.

◆ getAudioModule()

IAudioModule * getAudioModule ( )

Le module audio de ce vendor.

Symbole recherche : getAudioModule. Instance separee du graphique : l'audio n'a aucun couplage a la fenetre, et son peripherique ne s'ouvre qu'au premier appel.

◆ getGraphic2Module()

IGraphic2Module * getGraphic2Module ( )

Le module graphique 2D de ce vendor.

Symbole recherche : getGraphic2Module. Sa presence dit au chargeur que ce vendor sait dessiner en 2D.

◆ getGraphic3Module()

IGraphic3Module * getGraphic3Module ( )

Le module graphique 3D de ce vendor.

Symbole recherche : getGraphic3Module. Rend la MEME instance que getGraphic2Module(), vue par l'autre bout de la chaine d'heritage : RayGraphicModule implemente IGraphic3Module, qui EST un IGraphic2Module. Une seule implementation, aucun risque que les deux vues divergent.

Un vendor sans 3D n'exporte tout simplement pas ce symbole.

◆ getModules()

IModule ** getModules ( )

Tout ce que cette dll fournit, sans avoir a nommer un contrat.

Le point d'entree d'AnonymousModuleManager : un nom unique, le meme pour toutes les dll, donc trouvable sans connaitre les contrats a l'avance. Le chargeur trie ensuite par IModule::type().

IModule ** termine par nullptr, et pas un std::vector : un vecteur ne traverse pas un dlopen sans supposer la meme ABI de bibliotheque standard des deux cotes. La conversion vers IModule * se fait ICI, ou le type complet est connu, donc le decalage eventuel est applique par le compilateur et pas devine par l'appelant.

getGraphic3Module() n'y figure pas : c'est la MEME instance que la 2D, vue par l'autre bout de la chaine d'heritage. L'inscrire deux fois mettrait deux cases de la table sur un seul objet, et son type() ne peut en declarer qu'une.