Ejemplo n.º 1
0
int cLevel::render(SDL_Surface* dst) {
    for (int i = 0; i < walls.size(); ++i) {
        dispWall(dst, &walls[i], &vp);
    }
    for (int i = 0; i < 4; ++i) {
        dispWall(dst, &borders[i], &vp);
    }

    if (dirOn) {
        switch (dir) {
            case enumDirLEFT:
                filledTrigonRGBA(dst, 100, 0, 0, 50, 100, 100, 255, 0, 0, 255);
                break;
            case enumDirRIGHT:
                filledTrigonRGBA(dst, 0, 0, 100, 50, 0, 100, 255, 0, 0, 255);
                break;
            case enumDirUP:
                filledTrigonRGBA(dst, 50, 0, 100, 100, 0, 100, 255, 0, 0, 255);
                break;
            case enumDirDOWN:
                filledTrigonRGBA(dst, 0, 0, 100, 0, 50, 100, 255, 0, 0, 255);
                break;
        }
    }

    coord tc;
    tc = toScreen(playerPOI[0]);
    applySurface(sEntrance, dst, tc.x - sEntrance->w/2, tc.y - sEntrance->h/2);
    tc = toScreen(playerPOI[1]);
    applySurface(sExit, dst, tc.x - sEntrance->w/2, tc.y - sEntrance->h/2);

    return 0;
}
Ejemplo n.º 2
0
void filledTrigon(void* s_in,
		  int x1, int y1,
		  int x2, int y2,
		  int x3, int y3,
		  int r, int g, int b, int a)
{
    SDL_Renderer* s = (SDL_Renderer*)s_in;
    filledTrigonRGBA(s, x1, y1, x2, y2, x3, y3, r, g, b, a);
}
Ejemplo n.º 3
0
void Character::Render(void) {
  // Draw some fancy speach bubbles. It is a bit of a mess, I am playing.
  if(_speachBubble.size() != 0) {
    if(_speachBubbleTimer.GetTicks() < SPEACH_BUBBLE_DISPLAY_LENGTH) {
      roundedBoxRGBA(screen, (x + w / 2) - 100,
                     y - 100,
                     (x + w / 2) + 100,
                     y - 35,
                     5, 255, 255, 255, 255);

      filledTrigonRGBA(screen, (x + w / 2) - 100,
                       y - 100,
                       (x + w / 2) - 10,
                       y - 40,
                       (x + w / 2) + 10,
                       y - 40,
                       255, 255, 255, 255);

      _speachBubbleText.Render((x + w / 2) - 90, y - 90);
    }
  }

  if(attacking && attackTimer.GetTicks() < ATTACKING_DISPLAY_LEN) {
    ApplySurface(x, y, _texture, screen, &_sprites[directionFacing][ANIM_ATTACK]);
    return;
  }
  else if(attacking)
    attacking = false;
  
  if(xVel == 0.0f && yVel == 0.0f)
    ApplySurface(x, y, _texture, screen, &_sprites[directionFacing][ANIM_NO_FOOT]);
  else {
    if(_animationTimer.GetTicks() > ANIMATION_SPEED) {
      if(_animationStage == ANIM_NO_FOOT) {
        if(_leftFoot == true)
          _animationStage = ANIM_RIGHT_FOOT;
        else
          _animationStage = ANIM_LEFT_FOOT;
      }
      else if(_animationStage == ANIM_LEFT_FOOT) {
        _animationStage = ANIM_NO_FOOT;
        _leftFoot = true;
      }
      else if(_animationStage == ANIM_RIGHT_FOOT) {
        _animationStage = ANIM_NO_FOOT;
        _leftFoot = false;
      }
      _animationTimer.Start();
    }
    ApplySurface(x, y, _texture, screen, &_sprites[directionFacing][_animationStage]);
  }
}
Ejemplo n.º 4
0
void desenhaFlecha (SDL_Surface * superficie, Nodo *orig, Nodo *dest)
{
	double mi;
	double xa, ya, xb, yb;
	double alfa, beta;
	double xc, yc;
	double vx, vy;
	double modac;
	double xe, ye, xf, yf;

	xa = orig->getX();
	ya = orig->getY();
	xb = dest->getX();
	yb = dest->getY();

	alfa = (xb-xa);
	beta = (yb-ya);

	mi = 1 - (RAIO/sqrt(alfa*alfa + beta*beta));
	xc = xa + mi * alfa;
	yc = ya + mi * beta;

	vx = (xc - xa) * cos(TETA) + (yc - ya) * sin(TETA);
	vy = -(xc - xa) * sin(TETA) + (yc - ya) * cos(TETA);

	vx = -vx;
	vy = -vy;

	modac = sqrt( (xc-xa)*(xc-xa) + (yc-ya)*(yc-ya) );

	xe = xc + vx*TAMFLECHA/modac;
	ye = yc + vy*TAMFLECHA/modac;

	vx = (xc - xa) * cos(-TETA) + (yc - ya) * sin(-TETA);
	vy = -(xc - xa) * sin(-TETA) + (yc - ya) * cos(-TETA);

	vx = -vx;
	vy = -vy;

	xf = xc + vx*TAMFLECHA/modac;
	yf = yc + vy*TAMFLECHA/modac;

	filledTrigonRGBA (superficie, METADE_LARG + xe, METADE_ALT + ye, METADE_LARG + xf, METADE_ALT + yf, METADE_LARG + xc, METADE_ALT + yc, 150, 150, 150, 255);

	return;
}
unsigned int viewer(state* s, action* a, double reward, void* instance) {

    char str[255];
    double ratioPixels = ((screenWidth / 2.0) - 20) / (2.0 * parameters[1]);
    int done = 0;
    SDL_Event event;

    SDL_FillRect(screen, NULL, SDL_MapRGBA(screen->format, 255,255,255,255));

    if(a != NULL) {
        sprintf(str, "Applied X Force 1: % f", a->xAcceleration1);
        stringRGBA(screen, 5, 5, str, 0, 0, 0, 255);
        sprintf(str, "Applied X Force 2: % f", a->xAcceleration2);
        stringRGBA(screen, 5, 25, str, 0, 0, 0, 255);
    }

    sprintf(str, "Angular Position1: % f", s->angularPosition1);
    stringRGBA(screen, 5, 15, str, 0, 0, 0, 255);

    sprintf(str, "Angular Position2: % f", s->angularPosition2);
    stringRGBA(screen, 5, 35, str, 0, 0, 0, 255);

    sprintf(str, "Distance         : % f", fabs(s->xPosition2 - s->xPosition1));
    stringRGBA(screen, 5, 45, str, 0, 0, 0, 255);

    sprintf(str, "Reward           : % f", reward);
    stringRGBA(screen, 5, 55, str, 0, 0, 0, 255);

    lineRGBA(screen, 10, screenHeight / 2.0, screenHeight - 10, screenHeight / 2.0, 0, 0, 0, 255);

    if(algorithm_drawingProcedure != NULL)
        algorithm_drawingProcedure(screen, screenWidth, screenHeight, instance);

    drawDIPS(screen, s, 0, 0, 0, 255, ratioPixels);

    if(a != NULL) {
        if(a->xAcceleration2 < 0)
            filledTrigonRGBA(screen, ((screenWidth / 2.0) * 3.0 / 4.0) - 10, screenHeight * 0.9, ((screenWidth / 2.0) * 3.0 / 4.0) - 20, (screenHeight * 0.9) - 5, ((screenWidth / 2.0) * 3.0 / 4.0) - 10, (screenHeight * 0.9) - 10 , 0, 0, 0, 255);
        else if(a->xAcceleration2 > 0)
            filledTrigonRGBA(screen, ((screenWidth / 2.0) * 3.0 / 4.0) + 10, screenHeight * 0.9, ((screenWidth / 2.0) * 3.0 / 4.0) + 20, (screenHeight * 0.9) - 5, ((screenWidth / 2.0) * 3.0 / 4.0) + 10, (screenHeight * 0.9) - 10, 0, 0, 0, 255);
        else
            boxRGBA(screen, ((screenWidth / 2.0) * 3.0 / 4.0) - 5, screenHeight * 0.9, ((screenWidth / 2.0) * 3.0 / 4.0) + 5, (screenHeight * 0.9) - 10, 0, 0, 0, 255);

        if(a->xAcceleration1 < 0)
            filledTrigonRGBA(screen, (screenWidth / 8.0) - 10, screenHeight * 0.9, (screenWidth / 8.0) - 20, (screenHeight * 0.9) - 5, (screenWidth / 8.0) - 10, (screenHeight * 0.9) - 10 , 0, 0, 0, 255);
        else if(a->xAcceleration1 > 0)
            filledTrigonRGBA(screen, (screenWidth / 8.0) + 10, screenHeight * 0.9, (screenWidth / 8.0) + 20, (screenHeight * 0.9) - 5, (screenWidth / 8.0) + 10, (screenHeight * 0.9) - 10, 0, 0, 0, 255);
        else
            boxRGBA(screen, (screenWidth / 8.0) - 5, screenHeight * 0.9, (screenWidth / 8.0) + 5, (screenHeight * 0.9) - 10, 0, 0, 0, 255);
    }

    if(algorithm_drawingProcedure != NULL)
        algorithm_drawingProcedure(screen, screenWidth, screenHeight, instance);

    SDL_Flip(screen);

    while(SDL_PollEvent(&event)) {
        switch (event.type) {
            case SDL_KEYDOWN:
                if(event.key.keysym.sym == SDLK_ESCAPE)
                    done = 1;
                if(event.key.keysym.sym == SDLK_SPACE)
                    done = waitForAnotherSpace();
                break;
	
            case SDL_QUIT:
                done = 1;
            break;

        }
    }

    SDL_framerateDelay(&fpsm);

    return done;

}
unsigned int viewer(state* s, double* a, double reward, void* instance) {

    char str[255];
    double cartPoleScalingFactor = (screenWidth / 2.0) - 20;
    double ratioPixels = cartPoleScalingFactor / (2.0 * parameters[1]);
    int done = 0;
    SDL_Event event;


    SDL_FillRect(screen, NULL, SDL_MapRGBA(screen->format, 255,255,255,255));

    if(a != NULL) {
        sprintf(str, "Applied X Force  : % f", ((parameters[7] + parameters[7]) * a[0]) - parameters[7]);
        stringRGBA(screen, 5, 5, str, 0, 0, 0, 255);
    }

    sprintf(str, "Angular Position: % f", s->angularPosition);
    stringRGBA(screen, 5, 15, str, 0, 0, 0, 255);

    sprintf(str, "Angular Velocity: % f", s->angularVelocity);
    stringRGBA(screen, 5, 25, str, 0, 0, 0, 255);

    sprintf(str, "X Position      : % f", s->xPosition);
    stringRGBA(screen, 5, 35, str, 0, 0, 0, 255);

    sprintf(str, "X Velocity      : % f", s->xVelocity);
    stringRGBA(screen, 5, 45, str, 0, 0, 0, 255);

    sprintf(str, "Reward          : % f", reward);
    stringRGBA(screen, 5, 55, str, 0, 0, 0, 255);

    stringRGBA(screen, 5, screenHeight - 10, "Press escape to quit", 0, 0, 0, 255);

    lineRGBA(screen, 10, screenHeight / 2.0, (screenWidth / 2.0) - 10, screenHeight / 2.0, 0, 0, 0, 255);
    drawPendulum(s, 0, 0, 0, 255, ratioPixels);

    if(a != NULL) {
        if(a[0] < 0.5)
            filledTrigonRGBA(screen, (screenWidth / 4.0) - 10, screenHeight * 0.9, (screenWidth / 4.0), (screenHeight * 0.9) - 5, (screenWidth / 4.0) - 10, (screenHeight * 0.9) - 10 , 0, 0, 0, 255);
        else if(a[0] > 0.5)
            filledTrigonRGBA(screen, (screenWidth / 4.0) + 10, screenHeight * 0.9, (screenWidth / 4.0) + 20, (screenHeight * 0.9) - 5, (screenWidth / 4.0) + 10, (screenHeight * 0.9) - 10, 0, 0, 0, 255);
        else
            boxRGBA(screen, (screenWidth / 4.0) - 5, screenHeight * 0.9, (screenWidth / 4.0) + 5, (screenHeight * 0.9) - 10, 0, 0, 0, 255);
    }

    if(algorithm_drawingProcedure != NULL)
        algorithm_drawingProcedure(screen, screenWidth, screenHeight, instance);

    SDL_Flip(screen);

    while(SDL_PollEvent(&event)) {
        switch (event.type) {
            case SDL_KEYDOWN:
                if(event.key.keysym.sym == SDLK_ESCAPE)
                    done = 1;
                if(event.key.keysym.sym == SDLK_SPACE)
                    done = waitForAnotherSpace();
                break;
	
            case SDL_QUIT:
                done = 1;
            break;

        }
    }

    SDL_framerateDelay(&fpsm);

    return done;

}
Ejemplo n.º 7
0
/*bool CollisionCheck( int PlayerX, int PlayerY, int PlayerSize, int EnemyX, int EnemyY, int EnemySize)
{
if (PlayerX > EnemyX + EnemySize)	return false;//(BOXA X VALUE > BOXB X VALUE + BOXB WIDTH VALUE)
if (PlayerX + EnemySize < EnemyX)	return false;
if (PlayerY > EnemyY + EnemySize)	return false;
if (PlayerY + EnemySize < EnemyY)	return false;
return true;

}*/
int main( int argc, char* args[])
{
	//******************************************************
	//					variable declaration
	//******************************************************

	SDL_Event event;
	//pixels per movement

	int X1 = 320;
	int Y1 = 240;

	bool bGameRunning = true;
	bool keysHeld [323] = {false};
	int screenX = 640;
	int screenY = 480;
	int XT0 = 0;
	int YT0 = 0;
	int XT1 = 0;
	int YT1 = 0;
	int XT2 = 0;
	int YT2 = 0;
	int XT3 = 0;
	int YT3 = 0;
	int XS0 = 0;
	int YS0 = 0;
	int XS1 = 0;
	int YS1 = 0;
	int XS2 = 0;
	int YS2 = 0;
	int RS = 0;
	srand ( time(NULL) );

	//******************************************************
	//					end variable declaration
	//******************************************************

	//The Images
	SDL_Surface* hello = NULL ;
	SDL_Surface* screen = NULL ;

	//Start SDL
	SDL_Init ( SDL_INIT_EVERYTHING ) ; //aprox 20

	//Set up screen
	screen = SDL_SetVideoMode ( 640, 480, 32, SDL_SWSURFACE );

	//load image
	//hello = SDL_LoadBMP ( "hello.bmp" );

	//*************************************************
	//					GAME LOOP
	//*************************************************

	while (bGameRunning == true) 
	{
		//***************************
		//			input
		//***************************
		if (SDL_PollEvent(&event))
		{
			if (event.type == SDL_QUIT)
			{
				bGameRunning = false;
			}
			if (event.type == SDL_KEYDOWN)
			{
				keysHeld[event.key.keysym.sym] = true;
			}
			if (event.type == SDL_KEYUP)
			{
				keysHeld[event.key.keysym.sym] = false;
			}
		}
		if ( keysHeld[SDLK_ESCAPE] )
		{
			bGameRunning = false;
		}

		//***************************
		//		   movement
		//***************************

		// initialize random seed:
		
		int XTMover = rand() % 640 + 1;
		int YTMover = rand() % 480 + 1;
		int x0 = XTMover;
		int y0 = YTMover;
		int shape = rand() % 3 + 1;
		int R = rand() % 255 + 1;
		int G = rand() % 255 + 1;
		int B = rand() % 255 + 1;
		RS = rand() % 10 + 20;


		if (shape == 1) // circle
		{
			filledEllipseRGBA(screen,x0,y0,RS,RS,R, G, B, 255);
		}
		if (shape == 2) // triangle
		{
			XT0 = x0;
			YT0 = y0;
			XT1 = XT0 - RS;
			YT1 = YT0 - RS;
			XT2 = XT0 - RS-RS-RS;
			YT2 = YT0 + RS;
			XT3 = XT0 + RS;
			YT3 = YT0 + RS;
			filledTrigonRGBA(screen,XT1,YT1,XT2,YT2,XT3,YT3,R, G, B, 255);
		}
		if (shape == 3) // square
		{
			XS0 = x0;
			YS0 = y0;
			XS1 = XS0 - RS;
			YS1 = YS0 - RS;
			XS2 = XS0 + RS;
			YS2 = YS0 + RS;
			boxRGBA(screen,XS1,YS1,XS2,YS2,R,G,B,255);
		}



		//***************************
		//	  collision detection
		//***************************

		//***************************
		//			drawing
		//***************************

		//Apply image to screen
		//SDL_BlitSurface (hello, NULL, screen, NULL );
		//SDL_FillRect(screen, &screen->clip_rect,SDL_MapRGB(screen->format, 255, 255, 255));
		//rectangleRGBA(screen,X,Y,X2,Y2,255,1,1,100);
		//boxRGBA(screen,X,Y,X2,Y2,R,G,B,A);
		//filledTrigonRGBA(screen,XT1,YT1,XT2,YT2,XT3,YT3,RE, GE, BE, A);
		//trigonRGBA(screen,X,Y,X2,Y2,X3,Y3,R, G, B, A);
		//filledEllipseRGBA(screen,X1,Y1,RS,RS,R, G, B, A);
		//ellipseRGBA(screen,x0,y0,15,15,RShield, GShield, BShield, A);


		//triforce code
		//filledTrigonRGBA(screen,X,Y,x2,y2,x3,y3,R, G, B, A);
		//filledTrigonRGBA(screen,x2,y2,X2,Y2,X4,Y4,R, G, B, A);
		//filledTrigonRGBA(screen,x3,y3,X4,Y4,X3,Y3,R, G, B, A);

		//small circle
		//ellipseRGBA(screen,X,Y,RX,RY,R, G, B, A);

		//test for flip errors
		if (SDL_Flip(screen) == -1)	
		{
			return 1;
		}

		//Pause
		SDL_Delay ( 25 );

		//bGameRunning = false;
	}


	//small circle
	//ellipseRGBA(screen,X,Y,RX,RY,R, G, B, A);

	//Pause
	SDL_Delay ( 2000 );

	//Free the loaded image
	SDL_FreeSurface( hello );

	//Quit SDL
	SDL_Quit();

	return 0;
}
Ejemplo n.º 8
0
/// @brief Renderer
void SquareApp::OnRender() {
	SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
	SDL_RenderClear(renderer);
	for (int x = 0; x < SQUARES_X; x++)
		for (int y = 0; y < SQUARES_Y; y++) {
			SDL_Rect squareRect = {x * LINE_WIDTH + xOffset, y * LINE_WIDTH + yOffset, LINE_WIDTH, LINE_WIDTH};
			Player op = currentPosition.squareState(x, y);
			switch (op) {
				case Player::ONE:
					SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0xFF, 0xFF);
					break;
				case Player::TWO:
					SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0x00, 0xFF);
					break;
				default:
					SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
			}
			SDL_RenderFillRect(renderer, &squareRect);
		}
	for (int x = 0; x < SQUARES_X; x++)
		for (int y = 0; y <= SQUARES_Y; y++) {
				SDL_Rect lrect = {
					x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
					y * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
					LINE_WIDTH - LINE_HEIGHT, 
					LINE_HEIGHT
				};
				if (currentPosition.horLineState(x, y)) {
					SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0xFF, 0xFF);
					SDL_RenderFillRect(renderer, &lrect);
					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0xFF, 0x00, 0xFF, 0xFF);

					filledTrigonRGBA(renderer, (x + 1) * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							(x + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							(x + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0xFF, 0x00, 0xFF, 0xFF);
				}
				else {
					SDL_SetRenderDrawColor(renderer, 0x30, 0x30, 0x30, 0xFF);
					SDL_RenderFillRect(renderer, &lrect);
					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0x30, 0x30, 0x30, 0xFF);

					filledTrigonRGBA(renderer, (x + 1) * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							(x + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							(x + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0x30, 0x30, 0x30, 0xFF);
				}
			}
	for (int x = 0; x <= SQUARES_X; x++)
		for (int y = 0; y < SQUARES_Y; y++) {
				SDL_Rect lrect = {
					x * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
					y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
					LINE_HEIGHT, 
					LINE_WIDTH - LINE_HEIGHT
				};
				if (currentPosition.verLineState(x, y)) {
					SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0xFF, 0xFF);
					SDL_RenderFillRect(renderer, &lrect);
					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							0xFF, 0x00, 0xFF, 0xFF);

					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							(y + 1) * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							(y + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							(y + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0xFF, 0x00, 0xFF, 0xFF);
				}
				else {
					SDL_SetRenderDrawColor(renderer, 0x30, 0x30, 0x30, 0xFF);
					SDL_RenderFillRect(renderer, &lrect);
					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							y * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							y * LINE_WIDTH + LINE_HEIGHT / 2 + yOffset, 
							0x30, 0x30, 0x30, 0xFF);

					filledTrigonRGBA(renderer, x * LINE_WIDTH + xOffset, 
							(y + 1) * LINE_WIDTH + yOffset, 
							x * LINE_WIDTH + LINE_HEIGHT / 2 + xOffset, 
							(y + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							x * LINE_WIDTH - LINE_HEIGHT / 2 + xOffset, 
							(y + 1) * LINE_WIDTH - LINE_HEIGHT / 2 + yOffset, 
							0x30, 0x30, 0x30, 0xFF);
				}
			}
	SDL_RenderPresent(renderer);
}
Ejemplo n.º 9
0
 void DrawingArea::DrawFilledTriangle(const int x1, const int y1, const int x2, const int y2, const int x3, const int y3, const SSDL::Color Color) {
     filledTrigonRGBA(this->surface, x1, y1, x2, y2, x3, y3, Color.GetRed(), Color.GetGreen(), Color.GetBlue(), Color.GetAlpha());
 }