opengl_x11

Playing with OpenGL
git clone git://bsandro.tech/opengl_x11
Log | Files | Refs | README | LICENSE

commit 3cde30ce082208b0cd8f485d13209fb1e6c3ea9a
parent c58e453b306bf1c372e59f8f481fc6e1705436bc
Author: bsandro <email@bsandro.tech>
Date:   Wed, 26 Nov 2025 01:47:36 +0200

sphere tuned

Diffstat:
Msphere.c | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/sphere.c b/sphere.c @@ -1,4 +1,4 @@ -/* 3D cube */ +/* 3D sphere */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -28,8 +28,8 @@ x; } // I can push that to the local variables but want to keep the array on stack for now. -#define STACKS 64 -#define SECTORS 64 +#define STACKS 128 +#define SECTORS 128 static const double current_ts() { struct timespec ts; @@ -208,7 +208,15 @@ int main(int argc, char *argv[]) { vec3 positions[1] = {{0,0,0}}; + glShadeModel(GL_SMOOTH); + glEnable(GL_MULTISAMPLE); glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_LINE_SMOOTH); + glEnable(GL_POLYGON_SMOOTH); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); GLuint vbo; glGenBuffers(1, &vbo);