MainWindow

class MainWindow

Represents an openGL window that displays the GBA video output.  Also emulates input.

Summary
MainWindowRepresents an openGL window that displays the GBA video output.
Functions
MainWindow
InitializeInitializes a window and opengl with its vbs and shaders
UpdateUpdates Window logic.
DrawDraws the video buffer with openGL.
GetShadersCodeGets the shaders code to draw a full screen quad.
GetPPURetrieves the ppu associated to this Window.

Functions

MainWindow

MainWindow(PPU *p,
Memory *m)

Parameters

pA pointer to the ppu of the associated GBA.
mA pointer to the memory of the associated GBA.

Initialize

int Initialize(int screenMultiplier = 1)

Initializes a window and opengl with its vbs and shaders

Parameters

screenMultiplierA multiplier for the screen size (if the multiplier is 1, it is 240x160).

Returns

An error code.  If 0, all went okay.

-1 = glfw Init error

-2 = glfw Window creation error

-3 = glew init error

Update

void Update()

Updates Window logic.

Draw

void Draw()

Draws the video buffer with openGL.

GetShadersCode

void GetShadersCode(char *vs,
char *fs)

Gets the shaders code to draw a full screen quad.

Parameters

vsThe buffer that will contain the Vertex Shader.
fsThe buffer that will contain the Fragment Shader.

GetPPU

inline PPU* GetPPU()

Retrieves the ppu associated to this Window.

class MainWindow
Represents an openGL window that displays the GBA video output.
MainWindow(PPU *p,
Memory *m)
int Initialize(int screenMultiplier = 1)
Initializes a window and opengl with its vbs and shaders
void Update()
Updates Window logic.
void Draw()
Draws the video buffer with openGL.
void GetShadersCode(char *vs,
char *fs)
Gets the shaders code to draw a full screen quad.
inline PPU* GetPPU()
Retrieves the ppu associated to this Window.
Close