瀏覽代碼

Merge pull request #382 from nounoursheureux/develop

Have SetShaderValue(i) take a const pointer
pull/384/head
Ray 7 年之前
committed by GitHub
父節點
當前提交
2eceecb7b7
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 4 行新增4 行删除
  1. +2
    -2
      src/raylib.h
  2. +2
    -2
      src/rlgl.c

+ 2
- 2
src/raylib.h 查看文件

@ -1075,8 +1075,8 @@ RLAPI Texture2D GetTextureDefault(void); // Get
// Shader configuration functions
RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
RLAPI void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float)
RLAPI void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int)
RLAPI void SetShaderValue(Shader shader, int uniformLoc, ">const float *value, int size); // Set shader uniform value (float)
RLAPI void SetShaderValuei(Shader shader, int uniformLoc, ">const int *value, int size); // Set shader uniform value (int)
RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)

+ 2
- 2
src/rlgl.c 查看文件

@ -2452,7 +2452,7 @@ int GetShaderLocation(Shader shader, const char *uniformName)
}
// Set shader uniform value (float)
void SetShaderValue(Shader shader, int uniformLoc, float *value, int size)
void SetShaderValue(Shader shader, int uniformLoc, ">const float *value, int size)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glUseProgram(shader.id);
@ -2468,7 +2468,7 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size)
}
// Set shader uniform value (int)
void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size)
void SetShaderValuei(Shader shader, int uniformLoc, ">const int *value, int size)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glUseProgram(shader.id);

Loading…
取消
儲存