SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
pixelManager.cpp
Go to the documentation of this file.
2
3
4void PixelManager::loadSprites(vector<Task>& tasks){
9}
10
13}
14
16 for(Task& t : drawTasks)t.wait();
18}
19
21 return window.getWindowSize().getY();
22}
23
25 return window.getWindowSize().getX();
26}
27
28vector<RGBAcolor>
29PixelManager::mirrorData(const vector<nsGraphics::RGBAcolor>& inPixels, unsigned rowSize) {
30 vector<RGBAcolor> outPixels;
31 // we reserve size so the vector doesn't dynamically grows
32 outPixels.reserve(inPixels.size());
33 //for each line of pixel
34 for(unsigned rowOffset=0; rowOffset < inPixels.size(); rowOffset+=rowSize){
35 // for each pixel of that line
36 for(unsigned j=0;j<rowSize;++j) {
37 // push back the pixel opposed to this one (still in the same line)
38 outPixels.push_back(inPixels[rowOffset + rowSize - j - 1]);
39 }
40 }
41 return std::move(outPixels);
42}
void finishFrame()
Préviens minGL que la frame est terminée.
void clearScreen()
Efface l'écran avec la couleur de fond spécifiée.
nsGraphics::Vec2D getWindowSize() const
Récupère la taille de la fenêtre.
void startFrame() const
clear the screen for a new frame
virtual void loadSprites(vector< Task > &tasks)
loads sprites in parallel using multiple threads
Definition: pixelManager.cpp:4
MySprite menuBackground
sprite of the background during menu
Definition: pixelManager.h:72
MySprite rightHand
sprite of the right hand of god
Definition: pixelManager.h:82
void endFrame() const
finish a frame render
unsigned getScreenHeight() const
give the height of the screen
unsigned getScreenWidth() const
give the width of the screen
vector< Task > drawTasks
Definition: pixelManager.h:53
MySprite logo
sprite of the logo of the game
Definition: pixelManager.h:67
MinGL & window
Definition: pixelManager.h:52
MySprite gameBackground
sprite of the background during gameplay
Definition: pixelManager.h:77
int getX() const
Récupère la Position X (abscisse)
int getY() const
Récupère la Position Y (ordonnée)
#define ADD_SPRITE_TASK2(X, Y)
Definition: pixelManager.h:45
#define ADD_SPRITE_TASK(X)
Definition: pixelManager.h:44
future< void > Task
Definition: pixelManager.h:47
uint32_t rowSize
Definition: sprite.h:4