瀏覽代碼

rlLoadShaderCode - set ShaderId variables to RLGL.State.default[VF]ShaderId if repesctive Code is NULL (#2281)

pull/2285/head
Matthew Owens 3 年之前
committed by GitHub
父節點
當前提交
e621efe79f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 10 行新增2 行删除
  1. +10
    -2
      src/rlgl.h

+ 10
- 2
src/rlgl.h 查看文件

@ -3544,8 +3544,16 @@ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode)
unsigned int vertexShaderId = 0;
unsigned int fragmentShaderId = 0;
if (vsCode != NULL) vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER);
if (fsCode != NULL) fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER);
if (vsCode != NULL) {
vertexShaderId = rlCompileShader(vsCode, GL_VERTEX_SHADER);
} else {
vertexShaderId = RLGL.State.defaultVShaderId;
}
if (fsCode != NULL) {
fragmentShaderId = rlCompileShader(fsCode, GL_FRAGMENT_SHADER);
} else {
fragmentShaderId = RLGL.State.defaultFShaderId;
}
// Load shader program if provided vertex/fragment shaders compile successfully
if ((vertexShaderId != 0) && (fragmentShaderId != 0)) id = rlLoadShaderProgram(vertexShaderId, fragmentShaderId);

Loading…
取消
儲存