mirror of
https://github.com/raysan5/raylib.git
synced 2025-11-16 07:11:11 +00:00
Updated several files while porting examples to web
This commit is contained in:
@@ -33,8 +33,6 @@
|
||||
#ifndef RLIGHTS_H
|
||||
#define RLIGHTS_H
|
||||
|
||||
#include "raylib.h"
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Defines and Macros
|
||||
//----------------------------------------------------------------------------------
|
||||
@@ -67,11 +65,16 @@ typedef struct {
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Global Variables Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
int lightsCount = 0; // Current amount of created lights
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//----------------------------------------------------------------------------------
|
||||
void CreateLight(int type, Vector3 pos, Vector3 targ, Color color, Shader shader); // Defines a light and get locations from PBR shader
|
||||
void UpdateLightValues(Shader shader, Light light); // Send to PBR shader light values
|
||||
Light CreateLight(int type, Vector3 pos, Vector3 targ, Color color, Shader shader); // Defines a light and get locations from PBR shader
|
||||
void UpdateLightValues(Shader shader, Light light); // Send to PBR shader light values
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -103,8 +106,7 @@ void UpdateLightValues(Shader shader, Light light);
|
||||
//----------------------------------------------------------------------------------
|
||||
// Global Variables Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
static Light lights[MAX_LIGHTS] = { 0 };
|
||||
static int lightsCount = 0; // Current amount of created lights
|
||||
// ...
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific Functions Declaration
|
||||
@@ -116,7 +118,7 @@ static int lightsCount = 0; // Current amount of created lights
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Defines a light and get locations from PBR shader
|
||||
void CreateLight(int type, Vector3 pos, Vector3 targ, Color color, Shader shader)
|
||||
Light CreateLight(int type, Vector3 pos, Vector3 targ, Color color, Shader shader)
|
||||
{
|
||||
Light light = { 0 };
|
||||
|
||||
@@ -146,10 +148,10 @@ void CreateLight(int type, Vector3 pos, Vector3 targ, Color color, Shader shader
|
||||
light.colorLoc = GetShaderLocation(shader, colorName);
|
||||
|
||||
UpdateLightValues(shader, light);
|
||||
|
||||
lights[lightsCount] = light;
|
||||
lightsCount++;
|
||||
}
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
// Send to PBR shader light values
|
||||
|
||||
Reference in New Issue
Block a user