Reorganized some video config dialog related code. Deleted remnants of the old DX11 config window.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6460 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak 2010-11-22 22:17:35 +00:00
parent cefaa393e6
commit 49120d113f
9 changed files with 96 additions and 250 deletions

View File

@ -1,6 +1,8 @@
#include "VideoConfigDiag.h"
#include "FileUtil.h"
#define _connect_macro_(b, f, c, s) (b)->Connect(wxID_ANY, (c), wxCommandEventHandler( f ), (wxObject*)0, (wxEvtHandler*)s)
// template instantiation
@ -41,17 +43,27 @@ void SettingChoice::UpdateValue(wxCommandEvent& ev)
ev.Skip();
}
void VideoConfigDiag::CloseDiag(wxCommandEvent&)
void VideoConfigDiag::Event_ClickClose(wxCommandEvent&)
{
Close();
}
VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
void VideoConfigDiag::Event_Close(wxCloseEvent& ev)
{
g_Config.Save((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
ev.Skip();
}
VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& _ininame)
: wxDialog(parent, -1,
wxString(wxT("Dolphin ")).append(wxString::FromAscii(title.c_str())).append(wxT(" Graphics Configuration")),
wxDefaultPosition, wxDefaultSize)
, vconfig(g_Config)
, ininame(_ininame)
{
vconfig.Load((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str());
wxNotebook* const notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize);
// -- GENERAL --
@ -80,14 +92,14 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
//}
// adapter // for D3D only
if (g_Config.backend_info.Adapters.size())
if (vconfig.backend_info.Adapters.size())
{
szr_basic->Add(new wxStaticText(page_general, -1, wxT("Adapter:")), 1, wxALIGN_CENTER_VERTICAL, 5);
wxChoice* const choice_adapter = new SettingChoice(page_general, vconfig.iAdapter);
std::vector<std::string>::const_iterator
it = g_Config.backend_info.Adapters.begin(),
itend = g_Config.backend_info.Adapters.end();
it = vconfig.backend_info.Adapters.begin(),
itend = vconfig.backend_info.Adapters.end();
for (; it != itend; ++it)
choice_adapter->AppendString(wxString::FromAscii(it->c_str()));
@ -124,23 +136,23 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
szr_enh->Add(new wxStaticText(page_general, -1, wxT("Anisotropic Filtering:")), 1, wxALIGN_CENTER_VERTICAL, 0);
const wxString af_choices[] = {wxT("1x"), wxT("2x"), wxT("4x"), wxT("8x"), wxT("16x")};
szr_enh->Add(new SettingChoice(page_general, vconfig.iMaxAnisotropy, 5, af_choices), 0, wxBOTTOM | wxLEFT, 5);
szr_enh->Add(new SettingChoice(page_general, vconfig.iMaxAnisotropy, 5, af_choices));
if (g_Config.backend_info.AAModes.size())
if (vconfig.backend_info.AAModes.size())
{
szr_enh->Add(new wxStaticText(page_general, -1, wxT("Anti-Aliasing:")), 1, wxALIGN_CENTER_VERTICAL, 0);
SettingChoice *const choice_aamode = new SettingChoice(page_general, vconfig.iMultisampleMode);
std::vector<std::string>::const_iterator
it = g_Config.backend_info.AAModes.begin(),
itend = g_Config.backend_info.AAModes.end();
it = vconfig.backend_info.AAModes.begin(),
itend = vconfig.backend_info.AAModes.end();
for (; it != itend; ++it)
choice_aamode->AppendString(wxString::FromAscii(it->c_str()));
choice_aamode->Select(vconfig.iMultisampleMode);
szr_enh->Add(choice_aamode, 0, wxBOTTOM | wxLEFT, 5);
szr_enh->Add(choice_aamode);
}
szr_enh->Add(new SettingCheckBox(page_general, wxT("Load Native Mipmaps"), vconfig.bUseNativeMips));
@ -185,13 +197,13 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
group_efbcopy->AddStretchSpacer(1);
group_efbcopy->Add(efbcopy_texture, 0, wxRIGHT, 5);
group_efbcopy->Add(efbcopy_ram, 0, wxRIGHT, 5);
if (!g_Config.backend_info.bSupportsEFBToRAM)
if (!vconfig.backend_info.bSupportsEFBToRAM)
{
efbcopy_ram->Disable();
g_Config.bCopyEFBToTexture = true;
vconfig.bCopyEFBToTexture = true;
efbcopy_texture->SetValue(true);
}
if (!g_Config.bEFBCopyEnable)
if (!vconfig.bEFBCopyEnable)
{
efbcopy_ram->Disable();
efbcopy_texture->Disable();
@ -227,7 +239,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
if (128 == vconfig.iSafeTextureCache_ColorSamples)
stc_fast->SetValue(true);
if (!g_Config.bSafeTextureCache)
if (!vconfig.bSafeTextureCache)
{
stc_safe->Disable();
stc_normal->Disable();
@ -288,14 +300,14 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
group_xfb->Add(virtual_xfb, 0, wxRIGHT, 5);
group_xfb->Add(real_xfb, 0, wxRIGHT, 5);
if (!g_Config.backend_info.bSupportsRealXFB)
if (!vconfig.backend_info.bSupportsRealXFB)
{
real_xfb->Disable();
g_Config.bUseRealXFB = false;
vconfig.bUseRealXFB = false;
virtual_xfb->SetValue(true);
}
if (!g_Config.bUseXFB)
if (!vconfig.bUseXFB)
{
real_xfb->Disable();
virtual_xfb->Disable();
@ -330,7 +342,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
szr_misc->Add(new SettingCheckBox(page_advanced, wxT("Enable Hotkeys"), vconfig.bOSDHotKey));
// postproc shader
if (g_Config.backend_info.PPShaders.size())
if (vconfig.backend_info.PPShaders.size())
{
szr_misc->Add(new wxStaticText(page_advanced, -1, wxT("Post-Processing Shader:")), 1, wxALIGN_CENTER_VERTICAL, 0);
@ -338,8 +350,8 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
choice_ppshader->AppendString(wxT("(off)"));
std::vector<std::string>::const_iterator
it = g_Config.backend_info.PPShaders.begin(),
itend = g_Config.backend_info.PPShaders.end();
it = vconfig.backend_info.PPShaders.begin(),
itend = vconfig.backend_info.PPShaders.end();
for (; it != itend; ++it)
choice_ppshader->AppendString(wxString::FromAscii(it->c_str()));
@ -359,7 +371,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title)
}
wxButton* const btn_close = new wxButton(this, -1, wxT("Close"), wxDefaultPosition);
_connect_macro_(btn_close, VideoConfigDiag::CloseDiag, wxEVT_COMMAND_BUTTON_CLICKED, this);
_connect_macro_(btn_close, VideoConfigDiag::Event_ClickClose, wxEVT_COMMAND_BUTTON_CLICKED, this);
Connect(-1, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(VideoConfigDiag::Event_Close), (wxObject*)0, this);
wxBoxSizer* const szr_main = new wxBoxSizer(wxVERTICAL);
szr_main->Add(notebook, 1, wxEXPAND | wxALL, 5);

View File

@ -48,9 +48,7 @@ private:
class VideoConfigDiag : public wxDialog
{
public:
VideoConfigDiag(wxWindow* parent, const std::string &title);
VideoConfig &vconfig;
VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& ininame);
protected:
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO
@ -117,7 +115,8 @@ protected:
ev.Skip();
}
void CloseDiag(wxCommandEvent&);
void Event_ClickClose(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
wxRadioButton* stc_safe;
wxRadioButton* stc_normal;
@ -128,6 +127,9 @@ protected:
SettingRadioButton* virtual_xfb;
SettingRadioButton* real_xfb;
VideoConfig &vconfig;
std::string ininame;
};
#endif

View File

@ -647,19 +647,6 @@
<References>
</References>
<Files>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath=".\Src\resource.h"
>
</File>
<File
RelativePath=".\Src\Resource.rc"
>
</File>
</Filter>
<Filter
Name="win32"
>

View File

@ -43,7 +43,6 @@
#include "MainBase.h"
#include "main.h"
#include "resource.h"
#include "VideoConfigDiag.h"
#include "TextureCache.h"
#include "VertexManager.h"
@ -148,9 +147,19 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
LogManager::SetInstance((LogManager*)globals->logManager);
}
void InitBackendInfo()
{
g_Config.backend_info.APIType = API_D3D11;
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
g_Config.backend_info.bSupportsEFBToRAM = false;
g_Config.backend_info.bSupportsRealXFB = false;
g_Config.backend_info.bAllowSignedBytes = true;
}
void DllConfig(void *_hParent)
{
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str());
#if defined(HAVE_WX) && HAVE_WX
InitBackendInfo();
HRESULT hr = D3D::GetDXGIFuncPointers();
if (FAILED(hr)) return;
@ -162,8 +171,9 @@ void DllConfig(void *_hParent)
PanicAlert("Failed to create IDXGIFactory object");
char tmpstr[512] = {};
DXGI_ADAPTER_DESC desc;
// adapters
g_Config.backend_info.Adapters.clear();
while (factory->EnumAdapters((UINT)g_Config.backend_info.Adapters.size(), &ad) != DXGI_ERROR_NOT_FOUND)
{
ad->GetDesc(&desc);
@ -172,28 +182,20 @@ void DllConfig(void *_hParent)
ad->Release();
}
g_Config.backend_info.APIType = API_D3D11;
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
g_Config.backend_info.bSupportsEFBToRAM = false;
g_Config.backend_info.bSupportsRealXFB = false;
g_Config.backend_info.bAllowSignedBytes = true;
#if defined(HAVE_WX) && HAVE_WX
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D11");
diag->ShowModal();
diag->Destroy();
#endif
UpdateActiveConfig();
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx11.ini").c_str());
factory->Release();
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D11", "gfx_dx11");
diag->ShowModal();
diag->Destroy();
D3D::UnloadDXGI();
#endif
}
void Initialize(void *init)
{
InitBackendInfo();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
// Create a shortcut to _pVideoInitialize that can also update it

View File

@ -1,47 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Resource.rc
//
#define IDD_ABOUT 102
#define IDD_SETTINGS 103
#define IDD_ADVANCED 105
#define IDC_ADAPTER 1001
#define IDC_VSYNC 1006
#define IDC_ASPECT_16_9 1008
#define IDC_ASPECT_4_3 1009
#define IDC_WIDESCREEN_HACK 1010
#define IDC_SAFE_TEXTURE_CACHE 1011
#define IDC_EFB_ACCESS_ENABLE 1012
#define IDC_WIREFRAME 1013
#define IDC_DISABLEFOG 1014
#define IDC_OVERLAYFPS 1015
#define IDC_OVERLAYSTATS 1016
#define IDC_OVERLAYPROJSTATS 1017
#define IDC_ENABLEEFBCOPY 1018
#define IDC_TEXFMT_OVERLAY 1024
#define IDC_TEXFMT_CENTER 1025
#define IDC_ENABLEXFB 1026
#define IDC_FORCEANISOTROPY 1027
#define IDC_EFBSCALEDCOPY 1029
#define IDC_OSDHOTKEY 1030
#define IDC_ASPECTRATIO 1040
#define IDC_SAFE_TEXTURE_CACHE_SAFE 1041
#define IDC_SAFE_TEXTURE_CACHE_NORMAL 1042
#define IDC_SAFE_TEXTURE_CACHE_FAST 1043
#define IDC_DLIST_CACHING 1044
#define IDC_ENABLEPIXELLIGHTING 1045
#define IDC_LOADHIRESTEXTURE 1046
#define IDC_DUMPTEXTURES 1047
#define IDC_INTERNALRESOLUTION 1048
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1046
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,119 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT DIALOGEX 0, 0, 188, 81
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Created by neobrain.",IDC_STATIC,7,7,85,9
LTEXT "Licensed under the terms of the GNU General Public License.",IDC_STATIC,7,17,85,9
LTEXT "Hardware requirements:",IDC_STATIC,7,37,174,26
LTEXT "Any GPU which supports at least DX10.",IDC_STATIC,15,47,174,26
END
IDD_SETTINGS DIALOGEX 0, 0, 244, 183
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "A&dapter:",IDC_STATIC,9,10,48,8
COMBOBOX IDC_ADAPTER,80,8,149,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "&V-Sync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,25,36,8
CONTROL "&Widescreen Hack",IDC_WIDESCREEN_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,25,67,10
LTEXT "&Aspect Ratio:",IDC_STATIC,9,40,48,8
COMBOBOX IDC_ASPECTRATIO,80,38,89,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Internal resolution:",IDC_STATIC,9,58,80,8
COMBOBOX IDC_INTERNALRESOLUTION,80,56,89,57,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,75,94,11
CONTROL "Enable &Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,89,108,11
CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,20,102,32,10
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,52,102,40,10
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,92,102,32,10
CONTROL "Enable Dlist Caching",IDC_DLIST_CACHING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,113,80,10
CONTROL "Enable Pixel Lighting",IDC_ENABLEPIXELLIGHTING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,127,81,10
END
IDD_ADVANCED DIALOGEX 0, 0, 244, 200
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "&Settings",IDC_STATIC,6,7,228,102
CONTROL "Overlay FPS counter",IDC_OVERLAYFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,18,82,8
CONTROL "Disable Fog",IDC_DISABLEFOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,78,8
CONTROL "Enable Hotkey",IDC_OSDHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,33,87,8
CONTROL "Enable EFB copy",IDC_ENABLEEFBCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,33,81,8
CONTROL "EFB Scaled Copy",IDC_EFBSCALEDCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,48,64,8
CONTROL "Enable &Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,48,87,8
CONTROL "Enable 16x &anisotropy filtering",IDC_FORCEANISOTROPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,63,110,8
CONTROL "Enable hires texture loading",IDC_LOADHIRESTEXTURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,78,112,8
CONTROL "Dump textures",IDC_DUMPTEXTURES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,93,60,8
GROUPBOX "Debugging Tools",IDC_STATIC,7,148,228,46
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,90,8
CONTROL "Enable TexFmt Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,174,92,10
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,174,52,10
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include <windows.h\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -155,24 +155,31 @@ void DllAbout(HWND _hParent)
//DialogBox(g_hInstance,(LPCTSTR)IDD_ABOUT,_hParent,(DLGPROC)AboutProc);
}
void DllConfig(void *_hParent)
void InitBackendInfo()
{
// If not initialized, only init D3D so we can enumerate resolutions.
if (!s_PluginInitialized)
D3D::Init();
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
g_Config.backend_info.APIType = API_D3D9;
g_Config.backend_info.bUseRGBATextures = false;
g_Config.backend_info.bUseRGBATextures = true;
g_Config.backend_info.bSupportsEFBToRAM = true;
g_Config.backend_info.bSupportsRealXFB = true;
g_Config.backend_info.bAllowSignedBytes = false;
}
void DllConfig(void *_hParent)
{
#if defined(HAVE_WX) && HAVE_WX
InitBackendInfo();
// If not initialized, only init D3D so we can enumerate resolutions.
if (!s_PluginInitialized)
D3D::Init();
// adapters
g_Config.backend_info.Adapters.clear();
for (int i = 0; i < D3D::GetNumAdapters(); ++i)
g_Config.backend_info.Adapters.push_back(D3D::GetAdapter(i).ident.Description);
// aamodes
g_Config.backend_info.AAModes.clear();
if (g_Config.iAdapter < D3D::GetNumAdapters())
{
const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter);
@ -181,20 +188,20 @@ void DllConfig(void *_hParent)
g_Config.backend_info.AAModes.push_back(adapter.aa_levels[i].name);
}
#if defined(HAVE_WX) && HAVE_WX
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D9");
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "Direct3D9", "gfx_dx9");
diag->ShowModal();
diag->Destroy();
#endif
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
UpdateActiveConfig();
if (!s_PluginInitialized)
D3D::Shutdown();
#endif
}
void Initialize(void *init)
{
InitBackendInfo();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
// Create a shortcut to _pVideoInitialize that can also update it

View File

@ -73,9 +73,6 @@ private:
unsigned int expanded_width, unsigned int tex_levels, PC_TexFormat pcfmt);
TCacheEntryBase* CreateRenderTargetTexture(unsigned int scaled_tex_w, unsigned int scaled_tex_h);
private:
bool isOGL() { return true; }
};
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);

View File

@ -163,34 +163,37 @@ void GetShaders(std::vector<std::string> &shaders)
}
}
void DllConfig(void *_hParent)
void InitBackendInfo()
{
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
g_Config.UpdateProjectionHack();
UpdateActiveConfig();
std::string caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
g_Config.backend_info.AAModes = std::vector<std::string>(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
GetShaders(g_Config.backend_info.PPShaders);
g_Config.backend_info.APIType = API_OPENGL;
g_Config.backend_info.bUseRGBATextures = false;
g_Config.backend_info.bSupportsEFBToRAM = true;
g_Config.backend_info.bSupportsRealXFB = true;
g_Config.backend_info.bAllowSignedBytes = true;
}
void DllConfig(void *_hParent)
{
#if defined(HAVE_WX) && HAVE_WX
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "OpenGL");
InitBackendInfo();
// aamodes
const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
g_Config.backend_info.AAModes.assign(caamodes, caamodes + sizeof(caamodes)/sizeof(*caamodes));
// pp shaders
GetShaders(g_Config.backend_info.PPShaders);
VideoConfigDiag *const diag = new VideoConfigDiag((wxWindow*)_hParent, "OpenGL", "gfx_opengl");
diag->ShowModal();
diag->Destroy();
#endif
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
UpdateActiveConfig();
}
void Initialize(void *init)
{
InitBackendInfo();
frameCount = 0;
SVideoInitialize *_pVideoInitialize = (SVideoInitialize*)init;
// Create a shortcut to _pVideoInitialize that can also update it