commit 9e27f5e0bb85d094da7b93b84b0190f201fa9c1c
parent 1fafa50a4833e1c448f3773c37d44466bdad90f0
Author: bsandro <email@bsandro.tech>
Date: Wed, 26 Nov 2025 22:30:04 +0200
geometry shader
Diffstat:
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/obj2d.c b/obj2d.c
@@ -57,7 +57,6 @@ void main() {
EmitVertex();
gl_Position = p+vec4(-0.1, -0.1, 0.0, 0.0);
EmitVertex();
-
EndPrimitive();
}
)";
@@ -153,10 +152,11 @@ int main(int argc, char *argv[]) {
glBindVertexArray(vao);
// x,y
- static const GLfloat vertices[] = {
- -0.5, -0.5,
- 0.5, -0.5,
- 0.5, 0.5
+ static const GLfloat vertices[][2] = {
+ {-0.3, -0.5},
+ { 0.6, -0.1},
+ { 0.4, 0.4},
+ {-0.5, 0.6}
};
GLuint vbo;
@@ -177,6 +177,9 @@ int main(int argc, char *argv[]) {
glVertexAttribPointer(position, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat), (void *)0);
glEnableVertexAttribArray(position);
+ glLineWidth(1.f);
+ glPointSize(4.f);
+
while (1) {
while (XPending(dpy)) {
XEvent xev;