format
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@62 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
ed7dc61897
commit
002e721a31
4 changed files with 77 additions and 68 deletions
|
|
@ -62,7 +62,7 @@ lib: src/libMw$(SO)
|
||||||
examples: $(EXAMPLES)
|
examples: $(EXAMPLES)
|
||||||
|
|
||||||
format:
|
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)
|
src/libMw$(SO): $(L_OBJS)
|
||||||
$(CC) $(L_LDFLAGS) -shared -o $@ $(L_OBJS) $(L_LIBS)
|
$(CC) $(L_LDFLAGS) -shared -o $@ $(L_OBJS) $(L_LIBS)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
MwWidget window, opengl;
|
MwWidget window, opengl;
|
||||||
int ow, oh;
|
int ow, oh;
|
||||||
|
double deg = 0;
|
||||||
|
|
||||||
void resize(MwWidget handle, void* user_data, void* call_data) {
|
void resize(MwWidget handle, void* user_data, void* call_data) {
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
|
@ -39,13 +40,21 @@ void tick(MwWidget handle, void* user_data, void* call_data){
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
|
glPushMatrix();
|
||||||
|
glRotatef(deg, 0, 0, 1);
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
glColor3f(1, 0, 0); glVertex2f(0, 0.8);
|
glColor3f(1, 0, 0);
|
||||||
glColor3f(0, 1, 0); glVertex2f(-0.8, -0.8);
|
glVertex2f(0, 0.8);
|
||||||
glColor3f(0, 0, 1); glVertex2f(0.8, -0.8);
|
glColor3f(0, 1, 0);
|
||||||
|
glVertex2f(-0.8, -0.8);
|
||||||
|
glColor3f(0, 0, 1);
|
||||||
|
glVertex2f(0.8, -0.8);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
MwOpenGLSwapBuffer(opengl);
|
MwOpenGLSwapBuffer(opengl);
|
||||||
|
|
||||||
|
deg += 120.0 / (1000.0 / MwWaitMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue