transparent-cube

Minimal cross-platform native/wasm graphics example.
git clone git://git.amin.space/transparent-cube.git
Log | Files | Refs | README | LICENSE

commit dcb96103bdb2ea281fed020c00b320cbe02eac78
parent 03d706351ed689b42c6853c00d6d979bb7305a6c
Author: amin <dev@aminmesbah.com>
Date:   Sun,  5 Aug 2018 22:14:50 +0000

Enable MSAA on Linux

FossilOrigin-Name: deafd9417ade0e938e1df5de436fcfdfde065de251dfc95f70cd4b661b0e21c3
Diffstat:
Msrc/game.c | 6++++++
Msrc/game.h | 1+
Msrc/platform_linux.c | 1+
3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -3,6 +3,7 @@ #include <assert.h> #include <math.h> +// TODO: remove references to emscripten #ifdef __EMSCRIPTEN__ #include <GLES3/gl3.h> #else @@ -152,6 +153,11 @@ void game_init(struct GameState *game_state, uint32_t screen_width, uint32_t scr game_state->cube_shader = shader_compile("shader/cube_v.glsl", "shader/cube_f.glsl"); glEnable(GL_DEPTH_TEST); + + // TODO: remove references to emscripten +#ifndef __EMSCRIPTEN__ + glEnable(GL_MULTISAMPLE); +#endif } diff --git a/src/game.h b/src/game.h @@ -1,6 +1,7 @@ #ifndef GAME_H #define GAME_H +// TODO: remove references to emscripten #ifdef __EMSCRIPTEN__ #include <GLES3/gl3.h> #else diff --git a/src/platform_linux.c b/src/platform_linux.c @@ -43,6 +43,7 @@ int main(void) glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); + glfwWindowHint(GLFW_SAMPLES, 4); GLFWwindow* window = glfwCreateWindow(PLATFORM_SCR_WIDTH, PLATFORM_SCR_HEIGHT, "Quaternion Demo", NULL, NULL); if (!window)