2015-09-26 02:07:48 -06:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
class SWOGLWindow
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 02:43:46 -06:00
|
|
|
static void Init(void* window_handle);
|
|
|
|
static void Shutdown();
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Will be printed on the *next* image
|
|
|
|
void PrintText(const std::string& text, int x, int y, u32 color);
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Image to show, will be swapped immediately
|
2016-09-21 10:54:22 -06:00
|
|
|
void ShowImage(const u8* data, int stride, int width, int height, float aspect);
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
int PeekMessages();
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
static std::unique_ptr<SWOGLWindow> s_instance;
|
2015-09-26 02:07:48 -06:00
|
|
|
|
|
|
|
private:
|
2016-06-24 02:43:46 -06:00
|
|
|
SWOGLWindow() {}
|
|
|
|
void Prepare();
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
struct TextData
|
|
|
|
{
|
|
|
|
std::string text;
|
|
|
|
int x, y;
|
|
|
|
u32 color;
|
|
|
|
};
|
|
|
|
std::vector<TextData> m_text;
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
bool m_init{false};
|
2015-09-26 02:07:48 -06:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
u32 m_image_program, m_image_texture, m_image_vao;
|
2015-09-26 02:07:48 -06:00
|
|
|
};
|