1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#include "turboscreen.hpp"
int main()
{
using namespace ts;
//ts::Screen s;
//ts::Pixel p;
//ts::Color c;
//ts::Event e;
Screen s;
Pixel p;
Color c;
Event e;
// Screen has a default screen of 800x600 located at 0,0 coords
//draw the whole screen 800x600 in Yellow
for (int y=0; y < 600; y++) {
for (int x=0; x < 800; x++) {
//ts::Pixel().drawPixel(s.getScreenBuffer(),x,y,ts::Color::RED);
p.drawPixel(s.getScreenBuffer(),x,y,RED);
}
}
//draw a pixel in each corner of screen 800x600 default
/*
p.drawPixel(s.getScreenBuffer(), 0, 0,ts::Color::WHITE);
p.drawPixel(s.getScreenBuffer(),799,599,ts::Color::WHITE);
p.drawPixel(s.getScreenBuffer(),799, 0,ts::Color::WHITE);
p.drawPixel(s.getScreenBuffer(),0 ,599,ts::Color::WHITE);
*/
p.drawPixel(s.getScreenBuffer(), 0, 0,c.RGBA(255,255,255)); //WHITE
p.drawPixel(s.getScreenBuffer(),799,599,WHITE);
p.drawPixel(s.getScreenBuffer(),799, 0,WHITE);
p.drawPixel(s.getScreenBuffer(),0 ,599,WHITE);
s.renderScreen();
//main loop
while (s.getScreenId()!=nullptr) {
e.waitEvent(s.getScreenId());
}
return 0;
}
|