lab4 start

This commit is contained in:
2022-03-29 11:44:36 -05:00
parent 91b0484a3a
commit 1156c003f9
9 changed files with 529 additions and 0 deletions

28
Lab4/main.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include "x11context.h"
#include <unistd.h>
#include <iostream>
int main(void)
{
GraphicsContext* gc = new X11Context(800,600,GraphicsContext::BLACK);
// draw some lines
gc->setColor(GraphicsContext::GREEN);
gc->setPixel(10,10);
gc->setPixel(30,30);
gc->drawLine(100,100,500,500);
gc->setColor(GraphicsContext::RED);
gc->drawLine(100,500,500,500);
gc->setColor(GraphicsContext::BLUE);
gc->drawLine(500,500,500,100);
gc->setColor(GraphicsContext::YELLOW);
gc->drawLine(500,100,100,100);
gc->setColor(GraphicsContext::MAGENTA);
gc->drawCircle(300,300,200);
sleep(10);
delete gc;
return 0;
}