mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-13 06:20:26 +02:00
GL UI in Win32: Some basics work.
This commit is contained in:
1 parent
e7989e88d8
commit
84fd5781de
24 files changed
+168
-141
No files matched your search
+29
-12
@@ -15,26 +15,31 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "base/NativeApp.h"
|
||||
#include "base/display.h"
|
||||
#include "base/mutex.h"
|
||||
#include "base/timeutil.h"
|
||||
#include "input/input_state.h"
|
||||
|
||||
#include "../Globals.h"
|
||||
#include "Core.h"
|
||||
#include "MemMap.h"
|
||||
#include "MIPS/MIPS.h"
|
||||
#include "Globals.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#ifdef _WIN32
|
||||
#include "Windows/OpenGLBase.h"
|
||||
#endif
|
||||
|
||||
#include "Host.h"
|
||||
|
||||
#include "Debugger/Breakpoints.h"
|
||||
#include "Core/Debugger/Breakpoints.h"
|
||||
|
||||
// HANDLE m_hStepEvent;
|
||||
event m_hStepEvent;
|
||||
recursive_mutex m_hStepMutex;
|
||||
event m_hInactiveEvent;
|
||||
recursive_mutex m_hInactiveMutex;
|
||||
InputState input_state;
|
||||
|
||||
// This can be read and written from ANYWHERE.
|
||||
volatile CoreState coreState = CORE_STEPPING;
|
||||
@@ -93,17 +98,29 @@ void Core_WaitInactive(int milliseconds)
|
||||
m_hInactiveEvent.wait_for(m_hInactiveMutex, milliseconds);
|
||||
}
|
||||
|
||||
void UpdateScreenScale() {
|
||||
dp_xres = PSP_CoreParameter().pixelWidth;
|
||||
dp_yres = PSP_CoreParameter().pixelHeight;
|
||||
pixel_xres = PSP_CoreParameter().pixelWidth;
|
||||
pixel_yres = PSP_CoreParameter().pixelHeight;
|
||||
g_dpi = 72;
|
||||
g_dpi_scale = 1.0f;
|
||||
pixel_in_dps = (float)pixel_xres / dp_xres;
|
||||
}
|
||||
|
||||
void Core_RunLoop()
|
||||
{
|
||||
while (!coreState) {
|
||||
currentMIPS->RunLoopUntil(0xFFFFFFFFFFFFFFFULL);
|
||||
if (coreState == CORE_NEXTFRAME)
|
||||
UpdateScreenScale();
|
||||
{
|
||||
#ifdef _WIN32
|
||||
coreState = CORE_RUNNING;
|
||||
GL_SwapBuffers();
|
||||
#endif
|
||||
lock_guard guard(input_state.lock);
|
||||
NativeUpdate(input_state);
|
||||
}
|
||||
NativeRender();
|
||||
// Simple throttling to not burn the GPU in the menu.
|
||||
if (!PSP_CoreParameter().fileToStart.size())
|
||||
Sleep(15);
|
||||
GL_SwapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user