c++ - Creating rectangle with SDL_FillRect -


My code is not working really (no error, but rectangle is not shown). I have 3 classes: seafaremwork, contalgel, sajam are wrong / missing?

My CFRMaker class starts SDL and sets video mode etc.

CRectangle.hpp:

  #ifndef RECTANGLE_HPP # defined RECTANGLE_HPP #include "framework.hpp" class CRectangle {public: CRectangle (); Create zerorectengle (int x, int y, int width, int height, int r, int g, int b); Private: SDL_Surface * m_pScreen; // CRRmaker on the screen indicator SDL_R reserve m_Rect; }; #endif   

CRectangle.cpp:

  #include "Rectangle.hpp" // Konstruktor // // Notice: Zieger Fan Screen Hollen // Kangaroo :: Contaggle () {// ZaZerF-ScreenHolidayM_PScreen = g_pFramework- & gt; GetScreen (); } // Konstruktor // createRectangle // // Organ: Viereck erstellen // void CRectangle :: createRectangle (int x, int y, int width, int height, int r, int g, int b) {m_Rect.x = x ; M_Rect.y = y; M_Rect.w = width; M_Rect.h = height; SDL_FillRect (m_p screen, & amp; m_Rect, SDL_MapRGB (m_pScreen-> format, R, G, B)); } // createRectangle   

CGame.cpp:

  ... // Simply important content m_pRectangleMenu = new CRectangle; M_pRectangleMenu-> CreateRectangle (100,100,400,400,233,34,34); ...    

  // just important content m_pRectangleMenu = new CRectangle; M_pRectangleMenu-> CreateRectangle (100,100,400,400,233,34,34);   

Well because you did not include "SDL_flip (screen_exchangeable)" ... maybe this is your problem. If not, you should post to SDL_Flip ().

Reagan

Comments