SDL2 Rendering Textures from Vector
SDL2 Rendering Textures from Vector I'm Trying to store the textures into a vector then draw them on screen from the vector.But it wouldn't draw anything at all,just the board empty.. main.cpp: ` #include <SDL.h> #include <SDL_image.h> #include <SDL_mixer.h> #include <iostream> #include "Sprite.h" #include "Init.h" #include "Drawer.h" #include <vector> int32_t mouseX,mouseY; char* backgroundImg = "download.png"; char* ChessImg = "ChessSprite.png"; int SquareWidth = 64; int SquareHeight= 64; int ExtraSquareWidth = 66; int ExtraSquareHeight = 66; std::vector<Sprite> BlackPieces; Drawer GameDrawer; Init Game; void InitializeGame() { Sprite Piece(Game.renderer,ChessImg,0,0,0,0); for(int i = 2;i <= 4;i++) { Piece.setRectDetails(ExtraSquareWidth*(i-2),0,68,68); Piece.setCropDetails(SquareWidth*i,0,SquareWidth,SquareHeight); BlackPieces.push_back(Piece); } ...