git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@62 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-09-29 08:22:34 +00:00
commit 002e721a31
4 changed files with 77 additions and 68 deletions

View file

@ -62,7 +62,7 @@ lib: src/libMw$(SO)
examples: $(EXAMPLES)
format:
clang-format --verbose -i $(shell find src include -name "*.c" -or -name "*.h")
clang-format --verbose -i $(shell find src include examples -name "*.c" -or -name "*.h")
src/libMw$(SO): $(L_OBJS)
$(CC) $(L_LDFLAGS) -shared -o $@ $(L_OBJS) $(L_LIBS)

View file

@ -6,6 +6,7 @@
MwWidget window, opengl;
int ow, oh;
double deg = 0;
void resize(MwWidget handle, void* user_data, void* call_data) {
unsigned int w, h;
@ -39,13 +40,21 @@ void tick(MwWidget handle, void* user_data, void* call_data){
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
glRotatef(deg, 0, 0, 1);
glBegin(GL_TRIANGLES);
glColor3f(1, 0, 0); glVertex2f(0, 0.8);
glColor3f(0, 1, 0); glVertex2f(-0.8, -0.8);
glColor3f(0, 0, 1); glVertex2f(0.8, -0.8);
glColor3f(1, 0, 0);
glVertex2f(0, 0.8);
glColor3f(0, 1, 0);
glVertex2f(-0.8, -0.8);
glColor3f(0, 0, 1);
glVertex2f(0.8, -0.8);
glEnd();
glPopMatrix();
MwOpenGLSwapBuffer(opengl);
deg += 120.0 / (1000.0 / MwWaitMS);
}
int main() {