D3D12Renderer: fixed some compilation errors

Removed GSFrameBase2 and D3DGSFrame.
Added frame for NullRender.
Minor improvements and fixes
This commit is contained in:
DH 2015-10-05 03:42:48 +03:00
parent 1c890f85c5
commit 4fdeeace66
30 changed files with 609 additions and 677 deletions

View file

@ -1,54 +1,22 @@
#include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "GLGSFrame.h"
#include "D3DGSFrame.h"
#include "Utilities/Timer.h"
#ifndef _WIN32
#include "frame_icon.xpm"
#endif
GLGSFrame::GLGSFrame()
: GSFrame(nullptr, "GSFrame[OpenGL]")
, m_frames(0)
GLGSFrame::GLGSFrame() : GSFrame("OpenGL")
{
SetIcon(wxICON(frame_icon));
canvas = new wxGLCanvas(this, wxID_ANY, NULL);
canvas->SetSize(GetClientSize());
m_canvas = new wxGLCanvas(this, wxID_ANY, NULL);
m_canvas->SetSize(GetClientSize());
canvas->Bind(wxEVT_LEFT_DCLICK, &GSFrame::OnLeftDclick, this);
}
void GLGSFrame::close()
{
GSFrame::Close();
}
bool GLGSFrame::shown()
{
return GSFrame::IsShown();
}
void GLGSFrame::hide()
{
GSFrame::Hide();
}
void GLGSFrame::show()
{
GSFrame::Show();
m_canvas->Bind(wxEVT_LEFT_DCLICK, &GSFrame::OnLeftDclick, this);
}
void* GLGSFrame::make_context()
{
return new wxGLContext(GetCanvas());
return new wxGLContext(m_canvas);
}
void GLGSFrame::set_current(draw_context_t ctx)
{
GetCanvas()->SetCurrent(*(wxGLContext*)ctx.get());
m_canvas->SetCurrent(*(wxGLContext*)ctx.get());
}
void GLGSFrame::delete_context(void* ctx)
@ -58,47 +26,18 @@ void GLGSFrame::delete_context(void* ctx)
void GLGSFrame::flip(draw_context_t context)
{
if (!canvas) return;
canvas->SetCurrent(*(wxGLContext*)context.get());
GSFrame::flip(context);
static Timer fps_t;
canvas->SwapBuffers();
m_frames++;
if (!m_canvas) return;
const std::string sub_title = Emu.GetTitle() + (Emu.GetTitleID().length() ? " [" + Emu.GetTitleID() + "] | " : " | ");
if (fps_t.GetElapsedTimeInSec() >= 0.5)
{
// can freeze on exit
SetTitle(wxString(sub_title.c_str(), wxConvUTF8) + wxString::Format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec()));
m_frames = 0;
fps_t.Start();
}
}
size2i GLGSFrame::client_size()
{
wxSize size = GetClientSize();
return{ size.GetWidth(), size.GetHeight() };
m_canvas->SetCurrent(*(wxGLContext*)context.get());
m_canvas->SwapBuffers();
}
void GLGSFrame::OnSize(wxSizeEvent& event)
{
if (canvas) canvas->SetSize(GetClientSize());
if (m_canvas)
m_canvas->SetSize(GetClientSize());
event.Skip();
}
void GLGSFrame::SetViewport(int x, int y, u32 w, u32 h)
{
/*
//ConLog.Warning("SetViewport(x=%d, y=%d, w=%d, h=%d)", x, y, w, h);
const wxSize client = GetClientSize();
const wxSize viewport = AspectRatio(client, wxSize(w, h));
const int vx = (client.GetX() - viewport.GetX()) / 2;
const int vy = (client.GetY() - viewport.GetY()) / 2;
glViewport(vx + x, vy + y, viewport.GetWidth(), viewport.GetHeight());
*/
}