Choose OpenGL or software rendere at the startup [IWAD] menu

Moderators: Rachael, dpJudas

User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Nash »

This is more a convenience feature... but would it be possible to let the user change the renderer on startup, like Skulltag/Zandronum? The reason is that, the software renderer takes aaaaaaages to start on my computer and sometimes when you want to just quickly test a mod... well, it can get frustrating have to wait for it... then change the renderer to OpenGL in-game... Alt F4... finally re-run the mod.

Sure, one could just set the arguments on startup or go into the INI and edit It but that's kind of user-unfriendly and I don't even know what the CVar name is, and when I'm in a hurry to do some testing... well, let's just say I can get impatient sometimes. XD

I just don't know if it's too late in time when the launcher/IWAD picker has started to be able to set the renderer. If it's not possible, then no problem; I won't lose sleep over it. it's just a "nice to have". :D
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

Considering the compile time of the LLVM drawers it is certainly worth considering. I could just backport Skulltag's code for this, since Torr neatly packed it into a nice repository for us anyway. :)

However, there is some deliberation over how the LLVM drawers are going to be handled some time in the (likely near) future. I'm going to wait on this until I hear from dpJudas about the drawer pre-compilation.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by dpJudas »

No worries, Nash, the startup time has begun to piss me off as well. :)

The plan is to move the LLVM codegen out of QZDoom itself and into an utility that outputs .asm and .s files. Those in turn will be added to CMakeList.txt so that when QZDoom is compiled you do not need LLVM at all, and when launching QZDoom it will be instant. The asm files contains functions for 4 different generations of CPUs (SSE2, SSE4.1, AVX and AVX-2). At run time, it will decide which bracket your CPU belongs to and then picks that family of drawers.

Only problem with this plan is that coding it is about as fun as watching paint dry. Which is why its been on the To Do list of mine for a while now. :)
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

Depending on what dpJudas thinks - I might go ahead and do this anyway, because I remember seeing that in Zandy's startup and how hugely handy it was (although personally nowadays I don't even use the IWAD picker I just "restart" ccmd into whatever game/file I want directly from the console). This is one of the most requested and most denied ZDoom features, and I can understand why, but unless it muddies up the code to such an extent that no one would even want to look at it much less touch it, I can't see how it would actually harm anything to backport this in.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by dpJudas »

You're more than welcome to improve the IWAD picker. Add a checkbox for lights.pk3 and brightmap.pk3 while you're at it. ;)
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Gez »

Independently of any issue with LLVM, I approve putting some checkboxes/radio buttons on the startup window.

Things That Would Make Sense To Me:
  • Radio button for software/OpenGL
  • Disable Autoload checkbox
  • Load default dynamic lights checkbox
  • Load default brightmaps checkbox
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

I have like little to no experience working with GUI widgets from code, except with LUA in World of Warcraft.

And I am assuming that I am going to be working with native Windows API's for this, except with the Linux implementation which has a GTK+ library handy (that I think ZDoom uses, anyway).

If I can find the proper code from Skulltag I can port that back, but adding in new options might be a bit of a doozy. :)
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

iwadbox.png
iwadbox.png (16.26 KiB) Viewed 3609 times
If anyone wants to add to this, feel free to make a pull request. Whatever becomes final, I'll submit as a pull request for GZDoom as well. :) (Although there's no guarantee Graf will accept it :P)
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Gez »

There's just the disable autoload checkbox I'd really want. I don't have a VC++ 2015 setup though, and could even less test the Linux/Mac side of things.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Edward-san »

I see no implementation on the Linux/Mac side, so there's nothing to worry about :P
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

Currently..... :twisted:

That may change in the near future when I get the itch to touch the code again.

As for the Mac part of it - someone else will have to do that, but I can assist with it after I do Linux.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Gez »

Okay, here's a quick change I tested on an old enough revision that I could compile it on my trusty old VC++ 2005.

In d_main.cpp, add this somewhere it makes sense near the header:

Code: Select all

CVAR(Bool, disableautoload, 0, CVAR_NOSET);
Then scroll down to AddAutoloadFiles. Replace

Code: Select all

if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload"))
with

Code: Select all

if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload") && !disableautoload)
You're nearly done with the original logic. The rest is pure mindless copy-pasting then changing values.

In win32/i_system.cpp:

Code: Select all

EXTERN_CVAR (Int, vid_renderer);
EXTERN_CVAR (Bool, fullscreen);
+EXTERN_CVAR (Bool, disableautoload);

Code: Select all

		// Check the current video settings.
		SendDlgItemMessage( hDlg, vid_renderer ? IDC_WELCOME_OPENGL : IDC_WELCOME_SOFTWARE, BM_SETCHECK, BST_CHECKED, 0 );
		SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_SETCHECK, fullscreen ? BST_CHECKED : BST_UNCHECKED, 0 );
+		SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_SETCHECK, disableautoload ? BST_CHECKED : BST_UNCHECKED, 0 );

Code: Select all

			SetQueryIWad(hDlg);
			vid_renderer = SendDlgItemMessage( hDlg, IDC_WELCOME_OPENGL, BM_GETCHECK, 0, 0 ) == BST_CHECKED;
			fullscreen = SendDlgItemMessage( hDlg, IDC_WELCOME_FULLSCREEN, BM_GETCHECK, 0, 0 ) == BST_CHECKED;
+			disableautoload = SendDlgItemMessage( hDlg, IDC_WELCOME_NOAUTOLOAD, BM_GETCHECK, 0, 0 ) == BST_CHECKED;
In win32/resource.h:

Code: Select all

#define IDC_WELCOME_SOFTWARE	4021
#define IDC_WELCOME_FULLSCREEN	4022
+#define IDC_WELCOME_NOAUTOLOAD	4023
In win32/zdoom.rc:

Code: Select all

-IDD_IWADDIALOG DIALOGEX 0, 0, 224, 236
+IDD_IWADDIALOG DIALOGEX 0, 0, 224, 246
STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION |
 WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Welcome"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
 ICON IDI_ICON1,IDC_STATIC,7,7,32,32
 LTEXT "Welcome to QZDoom!",IDC_STATIC,42,8,180,8
 LTEXT "<Version info>",IDC_WELCOME_VERSION,42,18,180,8
 GROUPBOX "IWAD selection",IDC_STATIC,8,32,224-16,102
 LTEXT "Select which game file (IWAD) to run.", IDC_STATIC,12,32+12,190,8
 LISTBOX IDC_IWADLIST,12,32+24,224-24,72,LBS_NOINTEGRALHEIGHT |
 WS_VSCROLL | WS_TABSTOP
 GROUPBOX "Video settings",IDC_STATIC,8,138,224-16,48
 LTEXT "Choose how QZDoom will render the game.", IDC_STATIC,12,148,190,8
 CONTROL "Hardware (OpenGL)",IDC_WELCOME_OPENGL,"Button",
 BS_AUTORADIOBUTTON,12,170,93,10
 CONTROL "Software (Doom)",IDC_WELCOME_SOFTWARE,"Button",
 BS_AUTORADIOBUTTON,12,160,93,10
 CONTROL "Fullscreen",IDC_WELCOME_FULLSCREEN,"Button",
 BS_AUTOCHECKBOX | WS_TABSTOP, 124,160,48,10
- CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,72,192,87,10
- DEFPUSHBUTTON "Play QZDoom",IDOK,8,236-18,90,14
- PUSHBUTTON "Exit",IDCANCEL,224-58,236-18,50,14
+ CONTROL "Disable autoload",IDC_WELCOME_NOAUTOLOAD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,72,192,87,10
+ CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,72,202,87,10
+ DEFPUSHBUTTON "Play GZDoom",IDOK,8,246-18,90,14
+ PUSHBUTTON "Exit",IDCANCEL,224-58,246-18,50,14
Or you can probably do that in a more WYSIWYG way with the built-in rc editor if you don't have an express edition that stubbornly refuses to let you change whatever so you have to edit in some other text editor instead.

Buttons for enabling/disabling loadings of standard brightmaps and dynlights probably wouldn't be too hard; you'd just need to add some other CVAR and the logic for loading them accordingly in d_main.cpp. Then it's some more mindless copy-pasting and value shuffling.
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

Okay, I've implemented this, but I am not going to do it by CVAR as it seems unnecessary - I just used a standard global variable bool instead.

Also, I am going to try and sync this project with this here: https://github.com/raa-eruanna/qzdoom/c ... m-zandiwad - I will not consider this complete until I get the Linux and Mac OS versions done, though.
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

Er - well, I thought Zandronum had a Mac and Linux implementation but it turns out it doesn't. I was just getting ready to backport the code only to discover it was all the same. So - I guess this can be closed.

I'll PR the GZDoom version. Any further changes to this should happen there, should it be accepted.
User avatar
Rachael
Developer
Developer
Posts: 3639
Joined: Sat May 13, 2006 10:30

Re: Choose OpenGL or software rendere at the startup [IWAD] menu

Post by Rachael »

No rest for the wicked. Or I am easily bored. Take your pick. https://github.com/raa-eruanna/qzdoom/c ... s?expand=1
iwadpicker2.png
iwadpicker2.png (17.24 KiB) Viewed 3566 times
1) Should this be merged in?
2) Should this be merged in on this pull request for GZDoom?
Locked

Return to “Closed Suggestions”