title: Rendering the map in SDL 2.0 C++
body: <p>I have a question regarding SDL 2.0 and rendering, my idea for map rendering (2d game like the old zeldas or pokemon on game boy) is to load a texture that will simulate the map (suppose like 2000x2000) in memory, then render the part where the camera is, but my problem is this:</p>
  
  <p>I CANT PUT ANY IMG BECAUSE I NEED 10 REP, SORRY. I TRIED</p>
  
  <p>This is the actual map represented (just a pokemon map that i got in google),this map is a .bmp and the size is= 800x553.</p>
  
  <p>this is the camera code im using(the .cpp):</p>
  
  <pre><code>    CCamera CCamera::CameraControl;
  
      CCamera::CCamera() {
       X = Y = 0;
  
       TargetX = TargetY = NULL;
  
       TargetMode = TARGET_MODE_NORMAL;
       }
  
       void CCamera::OnMove(int MoveX, int MoveY) {
       X += MoveX;
       Y += MoveY;
       }
  
       int CCamera::GetX() {
       int WWIDTH=640; 
      if(TargetX != NULL) {
      if(TargetMode == TARGET_MODE_CENTER) {
          return *TargetX - (WWIDTH / 2);
       }
  
      return *TargetX;
      }
  
    return X;
     }
  
     int CCamera::GetY() {
     int WHEIGHT=480; //Ver guia tutorial "SDL MAPAS", El creo un define.h el cual traia unos defaults
      if(TargetY != NULL) {
      if(TargetMode == TARGET_MODE_CENTER) {
          return *TargetY - (WHEIGHT / 2);
      }
  
      return *TargetY;
      }
  
      return Y;
       }   
  
     void CCamera::SetPos(int X, int Y) {
     this-&gt;X = X;
     this-&gt;Y = Y;
     }
  
     void CCamera::SetTarget(int* X, int* Y) {
      TargetX = X;
     TargetY = Y;
     }
  </code></pre>
  
  <p>and this is the code for drawing to the screen(.cpp):</p>
  
  <pre><code>    bool Texture::OnDraw(SDL_Renderer * Render, SDL_Texture * Texture_Dest, int X, int Y,int X2, int Y2,int W, int H){
  
  if (Render==NULL || Texture_Dest == NULL ){printf("No se pudo dibujar ya que El renderer o el destino o la fuente estaba vacio"); return false;}
  
  
  SDL_Rect DestR;
  
  DestR.x = X;
  DestR.y = Y;
  DestR.w = W;
  DestR.h = H;
  
  SDL_Rect SrcR;
  
  SrcR.x = X2;
  SrcR.y = Y2;
  SrcR.w = W;
  SrcR.h = H;
  
  
  SDL_RenderCopy(Render,Texture_Dest,&amp;SrcR,&amp;DestR);
  
   return true;
     }
  </code></pre>
  
  <p>my problem is: from the map texture i want to draw like a parts of the map but at small size and make it fit the whole screen, that is a 800x553, and im redering 640,480, if someone plays at 1024x740 will not work, like one of the citys of the map, but just the city fits the whole screen.</p>
  
  <p>thx</p>