changeset 2:ea3c427d922d

draw a weird filled rectangle
author Dennis C. M. <dennis@denniscm.com>
date Mon, 12 Jun 2023 18:45:30 +0100
parents d445f99d9b13
children e4003f606e07
files main.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Mon Jun 12 18:28:57 2023 +0100
+++ b/main.c	Mon Jun 12 18:45:30 2023 +0100
@@ -7,7 +7,7 @@
 
 
 void setup() {
-	
+
 	// Set background dark
 	glClearColor(0.0, 0.0, 0.0, 1.0);
 
@@ -18,17 +18,20 @@
 	// Matrix projection and reset with identity
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
-	
+
 	// Set the coordinates to be used with the viewport
-	gluOrtho2D(0, WIDTH, HEIGHT, 0);
+	gluOrtho2D(-300, 300, 300, -300);
+
+	glMatrixMode(GL_MODELVIEW);
+	glLoadIdentity();
+
 }
 
 
 void display() {
 	glClear(GL_COLOR_BUFFER_BIT);
-	glBegin(GL_POINTS);
-	glVertex2i(1920/2, 1080/2);
-	glEnd();
+	glRectf(100.0f, 100.0f, 200.0f, 200.0f);
+	//	glVertex2i(1920/2, 1080/2);
 	glFlush();
 }