2
0

raylib_shaders.c 3.3 KB

1234567891011121314151617181920212223242526272829303132
  1. // Shader loading/unloading functions
  2. char *LoadText(const char *fileName); // Load chars array from text file
  3. Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations
  4. void UnloadShader(Shader shader); // Unload a custom shader from memory
  5. Shader GetDefaultShader(void); // Get default shader
  6. Texture2D GetDefaultTexture(void); // Get default texture
  7. // Shader access functions
  8. int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
  9. void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float)
  10. void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int)
  11. void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
  12. void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
  13. void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
  14. // Shading beegin/end functions
  15. void BeginShaderMode(Shader shader); // Begin custom shader drawing
  16. void EndShaderMode(void); // End custom shader drawing (use default shader)
  17. void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied)
  18. void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
  19. // VR control functions
  20. void InitVrSimulator(int vrDevice); // Init VR simulator for selected device
  21. void CloseVrSimulator(void); // Close VR simulator for current device
  22. bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
  23. void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
  24. void ToggleVrMode(void); // Enable/Disable VR experience
  25. void BeginVrDrawing(void); // Begin VR simulator stereo rendering
  26. void EndVrDrawing(void); // End VR simulator stereo rendering