13#ifndef GUARD_PIXELMANAGER_H
14#define GUARD_PIXELMANAGER_H
17#include "mingl/mingl.h"
18#include "mingl/shape/line.h"
19#include "mingl/shape/triangle.h"
20#include "mingl/shape/rectangle.h"
21#include "mingl/shape/circle.h"
22#include "mingl/gui/sprite.h"
23#include "mingl/gui/text.h"
32typedef nsGui::GlutFont::GlutFonts
Font;
44#define ADD_SPRITE_TASK(X) ADD_SPRITE_TASK2(X, X)
45#define ADD_SPRITE_TASK2(X, Y) tasks.push_back((X).asyncLoad("assets/"#Y".si2"));
130 void drawPlayer(
unsigned x,
unsigned width,
const nsGraphics::RGBAcolor& color)
const;
139 void drawMissile(
const Position& baseVector,
unsigned width,
const nsGraphics::RGBAcolor& color)
const;
148 void drawTorpedo(
const Position& baseVector,
unsigned width,
const nsGraphics::RGBAcolor& color)
const;
150#define HEART_LENGTH 40
200 void drawText(
const Position& pos,
const string& text,
const RGBAcolor& color = nsGraphics::KWhite,
Font font = Font::BITMAP_TIMES_ROMAN_24)
const;
280 static vector<RGBAcolor> mirrorData(
const vector<RGBAcolor>& inPixels,
unsigned rowSize);
main display function, clear the window and calls sub display functions
void startFrame() const
clear the screen for a new frame
MySprite leftHand
sprite of the left hand of god
virtual void loadSprites(vector< Task > &tasks)
loads sprites in parallel using multiple threads
void drawGodFace(int y, bool angry=false) const
display god's face
PixelManager(MinGL &window)
constructor the pixel manager class
void drawSprite(const MySprite &msp, const Position &pos) const
display a sprite on screen
MySprite menuBackground
sprite of the background during menu
PlayMode showInitialMenu()
show the title screen of the game
MySprite rightHand
sprite of the right hand of god
void displayButton(const Position &baseVector, const string &text, nsGraphics::RGBAcolor &color)
display a menu button on screen
void endFrame() const
finish a frame render
void drawGodBench(int y) const
display god's bar
void drawMissile(const Position &baseVector, unsigned width, const nsGraphics::RGBAcolor &color) const
display a missile on screen
void drawText(const Position &pos, const string &text, const RGBAcolor &color=nsGraphics::KWhite, Font font=Font::BITMAP_TIMES_ROMAN_24) const
display text on screen
void drawInvaderB(const Position &baseVector, unsigned size, const RGBAcolor &color) const
display a type B invader on screen
unsigned getScreenHeight() const
give the height of the screen
void drawHeart(const Position &baseVector) const
display a singular heart on screen
void drawPlayer(unsigned x, unsigned width, const nsGraphics::RGBAcolor &color) const
display a player on screen
unsigned getScreenWidth() const
give the width of the screen
void drawTorpedo(const Position &baseVector, unsigned width, const nsGraphics::RGBAcolor &color) const
display a torpedo on screen
void drawInvaderA(const Position &baseVector, unsigned size, const RGBAcolor &color) const
display a type A invader on screen
MySprite logo
sprite of the logo of the game
void displayMenu(const Position &pos, Menu ¤tMenu)
display a menu on screen
bool showDeathMenu(const vector< ScoreLink > &rankings, const WinValue &winner)
show the menu after a player lose, or all invader has been defeated
void drawInvaderC(const Position &baseVector, unsigned size, const RGBAcolor &color) const
display a type C invader on screen
MySprite gameBackground
sprite of the background during gameplay
void askPlayerNameMenu(playerID pID, unsigned score, string &name)
nsGui::GlutFont::GlutFonts Font
PlayMode
List of all game playmode.
nsGraphics::Vec2D Position
WinValue
list of win values