diff options
| author | Andre Weissflog <floooh@gmail.com> | 2018-12-03 16:22:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-03 16:22:52 +0100 |
| commit | 43ddc6f0f175b18e16a36f156586458c927c2df0 (patch) | |
| tree | 8b7594afd561679400699ad013c1950c18d621c1 /README.md | |
| parent | 252180a3e9d7c97658be1f3c609ef7b60030c5da (diff) | |
| parent | 1c785d5e7ba8e3ed2253c81f0baac72ec03f5afb (diff) | |
Merge pull request #94 from iboB/master
Added names to public structs so they can be forward delcared
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -1,6 +1,6 @@ # Sokol -**Sokol (Сокол)**: Russian for Falcon, a smaller and more nimble +**Sokol (Сокол)**: Russian for Falcon, a smaller and more nimble bird of prey than the Eagle (Орёл, Oryol) Minimalistic header-only cross-platform libs in C: @@ -11,7 +11,7 @@ Minimalistic header-only cross-platform libs in C: - **sokol\_audio.h**: minimal buffer-streaming audio playback - **sokol\_args.h**: unified cmdline/URL arg parser for web and native apps -These are (mainly) the internal parts of the Oryol C++ framework +These are (mainly) the internal parts of the Oryol C++ framework rewritten in pure C as standalone header-only libs. WebAssembly is a 'first-class citizen', one important motivation for the @@ -81,16 +81,16 @@ int main() { // positions // colors 0.0f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, - -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f + -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f }; sg_buffer vbuf = sg_make_buffer(&(sg_buffer_desc){ .size = sizeof(vertices), - .content = vertices, + .content = vertices, }); /* a shader */ sg_shader shd = sg_make_shader(&(sg_shader_desc){ - .vs.source = + .vs.source = "#version 330\n" "in vec4 position;\n" "in vec4 color0;\n" @@ -442,7 +442,7 @@ Big stuff: # Updates -- **29-Oct-2018**: +- **29-Oct-2018**: - sokol_gfx.h has a new function **sg_append_buffer()** which allows to append new data to a buffer multiple times per frame and interleave this with draw calls. This basically implements the @@ -450,7 +450,7 @@ Big stuff: example usage, see the updated Dear ImGui samples in the [sokol_samples repo](https://github.com/floooh/sokol-samples) - the GL state cache in sokol_gfx.h handles buffers bindings in a - more robust way, previously it might have happened that the + more robust way, previously it might have happened that the buffer binding gets confused when creating buffers or updating buffer contents in the render loop @@ -472,7 +472,7 @@ header documentation, and the new sample [multiwindow-glfw](https://github.com/f - **31-Jan-2018**: The vertex layout declaration in sg\_pipeline\_desc had some fairly subtle flaws and has been changed to work like Metal or Vulkan. -The gist is that the vertex-buffer-layout properties (vertex stride, +The gist is that the vertex-buffer-layout properties (vertex stride, vertex-step-rate and -step-function for instancing) is now defined in a separate array from the vertex attributes. This removes some brittle backend code which tries to guess the right vertex attribute slot if no attribute @@ -486,18 +486,18 @@ Oryol Gfx module over to sokol-gfx). Some code samples: sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ .layout = { .buffers = { - [0] = { + [0] = { .stride = 20, .step_func = SG_VERTEXSTEP_PER_VERTEX, - .step_rate = 1 + .step_rate = 1 } }, .attrs = { - [0] = { - .name = "pos", - .offset = 0, + [0] = { + .name = "pos", + .offset = 0, .format = SG_VERTEXFORMAT_FLOAT3, - .buffer_index = 0 + .buffer_index = 0 }, [1] = { .name = "uv", @@ -514,16 +514,16 @@ sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ .layout = { .buffers = { - [0] = { + [0] = { .step_func = SG_VERTEXSTEP_PER_VERTEX, .step_rate=1 } }, .attrs = { - [0] = { - .name = "pos", + [0] = { + .name = "pos", .format = SG_VERTEXFORMAT_FLOAT3, - .buffer_index = 0 + .buffer_index = 0 }, [1] = { .name = "uv", |