Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/OpenGL/EC/opengl.ec
Normal file
35
Task/OpenGL/EC/opengl.ec
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include <GL/gl.h>
|
||||
import "ecere"
|
||||
|
||||
class GLTriangle : Window
|
||||
{
|
||||
text = "Triangle";
|
||||
displayDriver = "OpenGL";
|
||||
background = activeBorder;
|
||||
nativeDecorations = true;
|
||||
borderStyle = sizable;
|
||||
hasMaximize = true, hasMinimize = true, hasClose = true;
|
||||
size = { 640, 480 };
|
||||
|
||||
void OnRedraw(Surface surface)
|
||||
{
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-30, 30, -30, 30, -30, 30);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(-15, -15, 0);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex2f(0, 0);
|
||||
glColor3f(0, 1, 0);
|
||||
glVertex2f(30, 0);
|
||||
glColor3f(0, 0, 1);
|
||||
glVertex2f(0, 30);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
GLTriangle window {};
|
||||
Loading…
Add table
Add a link
Reference in a new issue