diff options
| author | Ray <[email protected]> | 2021-04-06 13:02:57 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-04-06 13:02:57 +0200 |
| commit | 9fa9c30a3d2c27ce210f64e9ab636377792c74be (patch) | |
| tree | d887fefb84f3fb09e164c129737cdeafd8086aa3 /cheatsheet | |
| parent | 8940a2f553026e46fc97f49c449fe199df36745a (diff) | |
| download | raylib.com-9fa9c30a3d2c27ce210f64e9ab636377792c74be.tar.gz raylib.com-9fa9c30a3d2c27ce210f64e9ab636377792c74be.zip | |
Cheatsheet: move shaders funcs to core
Diffstat (limited to 'cheatsheet')
| -rw-r--r-- | cheatsheet/cheatsheet.html | 8 | ||||
| -rw-r--r-- | cheatsheet/raylib_core.c | 17 | ||||
| -rw-r--r-- | cheatsheet/raylib_shaders.c | 18 |
3 files changed, 17 insertions, 26 deletions
diff --git a/cheatsheet/cheatsheet.html b/cheatsheet/cheatsheet.html index df6be81..68d80fb 100644 --- a/cheatsheet/cheatsheet.html +++ b/cheatsheet/cheatsheet.html @@ -49,7 +49,6 @@ } .exdownbtn:hover{background-color:#f0d6d6; color:#c55757; border:4px solid #e66666;} #core pre code{border:10px solid; border-color:#888888; background-color:#dbdbe1; } - #shaders pre code{border:10px solid; border-color:#a864d2; background-color:#e0c6f1; } #shapes pre code{border:10px solid; border-color:#e66666; background-color:#e9d0d6; } #textures pre code{border:10px solid; border-color:#75a06d; background-color:#c3e4bf; } #text pre code{border:10px solid; border-color:#52b296; background-color:#b9e9dd; } @@ -69,7 +68,6 @@ #ptextures{margin-bottom:-12px; margin-left:12px; color:#60815a;} #ptext{margin-bottom:-12px; margin-left:12px; color:#377764;} #pmodels{margin-bottom:-12px; margin-left:12px; color:#417794;} - #pshaders{margin-bottom:-12px; margin-left:12px; color:#a864d2;} #paudio{margin-bottom:-12px; margin-left:12px; color:#8c7539;} #pstructs{margin-bottom:-12px; margin-left:12px; color:#bcbccd;} #pcolors{margin-bottom:-12px; margin-left:12px; color:#bcbccd;} @@ -93,10 +91,6 @@ $('#core pre code').text(data); $('#core pre code').each(function(i, e) {hljs.highlightBlock(e)}); }, 'text'); - $.get('raylib_shaders.c', function(data) { - $('#shaders pre code').text(data); - $('#shaders pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); $.get('raylib_shapes.c', function(data) { $('#shapes pre code').text(data); $('#shapes pre code').each(function(i, e) {hljs.highlightBlock(e)}); @@ -141,8 +135,6 @@ <div id="fulldata"> <p id="pcore">module: core</p> <div id="core"><pre><code class="cpp"></code></pre></div> - <p id="pshaders">module: shaders (rlgl)</p> - <div id="shaders"><pre><code class="cpp"></code></pre></div> <p id="pshapes">module: shapes</p> <div id="shapes"><pre><code class="cpp"></code></pre></div> <p id="ptextures">module: textures</p> diff --git a/cheatsheet/raylib_core.c b/cheatsheet/raylib_core.c index d6d92d7..b80774a 100644 --- a/cheatsheet/raylib_core.c +++ b/cheatsheet/raylib_core.c @@ -200,3 +200,20 @@ void EndVrDrawing(void); // End VR simulator stereo rendering VrStereoConfig GetVrConfig(VrDeviceInfo device); // Get stereo rendering configuration parameters + // Shaders System Functions + void BeginShaderMode(Shader shader); // Begin custom shader drawing + void EndShaderMode(void); // End custom shader drawing (use default shader) + void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) + void EndBlendMode(void); // End blending mode (reset to default: alpha blending) + + // Shader management functions + Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations + Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations + int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location + int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location + void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value + void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector + void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) + void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) + void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) + diff --git a/cheatsheet/raylib_shaders.c b/cheatsheet/raylib_shaders.c deleted file mode 100644 index d808d18..0000000 --- a/cheatsheet/raylib_shaders.c +++ /dev/null @@ -1,18 +0,0 @@ - - // Shaders System Functions (Module: core) - void BeginShaderMode(Shader shader); // Begin custom shader drawing - void EndShaderMode(void); // End custom shader drawing (use default shader) - void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) - void EndBlendMode(void); // End blending mode (reset to default: alpha blending) - - // Shader management functions - Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations - Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations - int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location - int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location - void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value - void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count); // Set shader uniform value vector - void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat); // Set shader uniform value (matrix 4x4) - void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); // Set shader uniform value for texture (sampler2d) - void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) - |
