mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-21 10:20:46 +00:00
- trying to initialize OpenGL right at the beginning.
Right now it has to be done after loading the IWAD, meaning it cannot be used to render the IWAD selection box, but it can be done before the start screen, so that this can be drawn with the render backend instead of Windows. Note that in this commit the startup screens do not show.
This commit is contained in:
parent
b0acfc3ce6
commit
35b386fb5f
4 changed files with 24 additions and 43 deletions
|
@ -2439,6 +2439,17 @@ void D_DoomMain (void)
|
|||
allwads.ShrinkToFit();
|
||||
SetMapxxFlag();
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
if (!batchrun) Printf("I_Init: Setting up machine state.\n");
|
||||
I_Init();
|
||||
if (!batchrun) Printf("V_Init: allocate screen.\n");
|
||||
V_InitScreenSize();
|
||||
|
||||
// This allocates a dummy framebuffer as a stand-in until V_Init2 is called.
|
||||
V_InitScreen();
|
||||
}
|
||||
|
||||
GameConfig->DoKeySetup(gameinfo.ConfigName);
|
||||
|
||||
// Now that wads are loaded, define mod-specific cvars.
|
||||
|
@ -2462,27 +2473,9 @@ void D_DoomMain (void)
|
|||
|
||||
CT_Init ();
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
if (!batchrun) Printf ("I_Init: Setting up machine state.\n");
|
||||
I_Init ();
|
||||
}
|
||||
|
||||
// [RH] Initialize palette management
|
||||
InitPalette ();
|
||||
|
||||
if (!batchrun) Printf ("V_Init: allocate screen.\n");
|
||||
if (!restart)
|
||||
{
|
||||
V_InitScreenSize();
|
||||
}
|
||||
|
||||
if (!restart)
|
||||
{
|
||||
// This allocates a dummy framebuffer as a stand-in until V_Init2 is called.
|
||||
V_InitScreen ();
|
||||
}
|
||||
|
||||
if (restart)
|
||||
{
|
||||
// Update screen palette when restarting
|
||||
|
|
|
@ -538,17 +538,6 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
|
|||
|
||||
bool IVideo::SetResolution ()
|
||||
{
|
||||
DFrameBuffer *buff = CreateFrameBuffer();
|
||||
|
||||
if (buff == NULL) // this cannot really happen
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
screen = buff;
|
||||
screen->InitializeState();
|
||||
screen->SetGamma();
|
||||
|
||||
V_UpdateModeSize(screen->GetWidth(), screen->GetHeight());
|
||||
|
||||
return true;
|
||||
|
@ -597,27 +586,25 @@ void V_InitScreenSize ()
|
|||
|
||||
void V_InitScreen()
|
||||
{
|
||||
screen = new DDummyFrameBuffer (vid_defwidth, vid_defheight);
|
||||
I_InitGraphics();
|
||||
screen = Video->CreateFrameBuffer();
|
||||
if (screen == nullptr)
|
||||
{
|
||||
I_FatalError("Unable to create frame buffer");
|
||||
}
|
||||
screen->InitializeState();
|
||||
screen->SetGamma();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void V_Init2()
|
||||
{
|
||||
float gamma = static_cast<DDummyFrameBuffer *>(screen)->Gamma;
|
||||
|
||||
{
|
||||
DFrameBuffer *s = screen;
|
||||
screen = NULL;
|
||||
delete s;
|
||||
}
|
||||
|
||||
UCVarValue val;
|
||||
|
||||
val.Bool = !!Args->CheckParm("-devparm");
|
||||
ticker.SetGenericRepDefault(val, CVAR_Bool);
|
||||
|
||||
|
||||
I_InitGraphics();
|
||||
|
||||
Video->SetResolution(); // this only fails via exceptions.
|
||||
Printf ("Resolution: %d x %d\n", SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
|
@ -629,6 +616,7 @@ void V_Init2()
|
|||
FBaseCVar::ResetColors ();
|
||||
C_NewModeAdjust();
|
||||
setsizeneeded = true;
|
||||
setmodeneeded = true;
|
||||
}
|
||||
|
||||
void V_Shutdown()
|
||||
|
|
|
@ -353,7 +353,7 @@ SystemBaseFrameBuffer::SystemBaseFrameBuffer(void *hMonitor, bool fullscreen) :
|
|||
{
|
||||
m_Monitor = hMonitor;
|
||||
m_displayDeviceName = 0;
|
||||
PositionWindow(fullscreen, true);
|
||||
//PositionWindow(fullscreen, true);
|
||||
|
||||
HDC hDC = GetDC(Window);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer()
|
|||
{
|
||||
SystemGLFrameBuffer *fb;
|
||||
|
||||
fb = new OpenGLRenderer::OpenGLFrameBuffer(m_hMonitor, fullscreen);
|
||||
fb = new OpenGLRenderer::OpenGLFrameBuffer(m_hMonitor, false);
|
||||
return fb;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue