rendered paste body#include "graphics.hpp"
#include "uszo.cpp"
using namespace genv;
int main()
{
gout.open(400,400);
widget x;
rgbcolor sarga(255,255,0);
rgbcolor fekete(0,0,0);
x.cel_kereszt(200,200,10, sarga, fekete);
gout << refresh;
event ev;
while(gin) {gin >> ev;}
}
####################################################################
#include "uszo.h"
#include "graphics.hpp"
using namespace genv;
rgbcolor::rgbcolor(int r, int g, int b)
: red(r), green(g), blue(b) {}
void widget::cel(int x, int y, int r, rgbcolor szin){
gout << color(szin.red,szin.green,szin.blue);
for(int i=-r; i<r; i++){
for(int j=-r; j<r; j++){
if(i*i+j*j<=r*r){
gout << move_to(i+x,j+y) << dot;
}
}
}
}
void widget::cel_kereszt(int a, int b, int c, rgbcolor szin1, rgbcolor szin2){
cel(a,b,c,szin1);
cel(a,b,c-3,szin2);
gout << color(szin1.red,szin1.green,szin1.blue) << move_to(a-c+2,b) << line_to(a+c-2,b)<< move_to(a,b-c+2)<< line_to(a,b+c-2);
}
#######################################################################################
#ifndef USZO_H_INCLUDED
#define USZO_H_INCLUDED
struct rgbcolor
{
rgbcolor( int r, int g, int b );
int red, green, blue;
};
class widget{
public:
void cel(int x, int y, int r, rgbcolor szin);
void cel_kereszt(int a, int b, int c, rgbcolor szin1, rgbcolor szin2);
};
#endif // USZO_H_INCLUDED
##########################################################################################