raylib_shaders.c 3.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Shader loading/unloading functions
  2. Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations
  3. void UnloadShader(Shader shader); // Unload a custom shader from memory
  4. Shader GetDefaultShader(void); // Get default shader
  5. Shader GetStandardShader(void); // Get standard 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. // Light creation/destruction functions
  20. Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool
  21. void DestroyLight(Light light); // Destroy a light and take it out of the list
  22. // VR control functions
  23. void InitVrDevice(int vrDevice); // Init VR device
  24. void CloseVrDevice(void); // Close VR device
  25. bool IsVrDeviceReady(void); // Detect if VR device is ready
  26. bool IsVrSimulator(void); // Detect if VR simulator is running
  27. void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera
  28. void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator)