config.opengl_scanline_horiz = false;
config.use_opengl_filters = false;
config.opengl_filter_num = 0;
-
+ config.render_platform = CONFIG_RENDER_PLATFORM_OPENGL_MAIN;
+ config.render_major_version = 3;
+ config.render_minor_version = 0;
config.log_to_syslog = false;
config.log_to_console = true;
config.use_opengl_filters, config_path);
config.opengl_filter_num = MyGetPrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
config.opengl_filter_num, config_path);
+ config.render_platform = MyGetPrivateProfileInt(_T("Screen"), _T("RenderPlatform"),
+ config.render_platform, config_path);
+ config.render_major_version = MyGetPrivateProfileInt(_T("Screen"), _T("RenderMajorVersion"),
+ config.render_major_version, config_path);
+ config.render_minor_version = MyGetPrivateProfileInt(_T("Screen"), _T("RenderMinorVersion"),
+ config.render_minor_version, config_path);
config.rendering_type = MyGetPrivateProfileInt(_T("Screen"), _T("RenderType"),
config.rendering_type, config_path);
if(config.rendering_type < 0) config.rendering_type = 0;
MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"), config.use_opengl_filters, config_path);
MyWritePrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"), config.opengl_filter_num, config_path);
MyWritePrivateProfileInt(_T("Screen"), _T("RenderType"), config.rendering_type, config_path);
+ MyWritePrivateProfileInt(_T("Screen"), _T("RenderPlatform"), config.render_platform, config_path);
+ MyWritePrivateProfileInt(_T("Screen"), _T("RenderMajorVersion"), config.render_major_version, config_path);
+ MyWritePrivateProfileInt(_T("Screen"), _T("RenderMinorVersion"), config.render_minor_version, config_path);
#endif
// screen
#ifdef USE_SCREEN_ROTATE
MyWritePrivateProfileInt(_T("Screen"), _T("RotateType"), config.rotate_type, config_path);
#endif
-#if defined(_USE_QT)
- MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLScanLine"),
- config.use_opengl_scanline, config_path);
- MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineVert"),
- config.opengl_scanline_vert, config_path);;
- MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineHoriz"),
- config.opengl_scanline_horiz, config_path);;
- MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"),
- config.use_opengl_filters, config_path);
- MyWritePrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
- config.opengl_filter_num, config_path);
-#endif
// sound
MyWritePrivateProfileInt(_T("Sound"), _T("Frequency"), config.sound_frequency, config_path);
CONFIG_RENDER_TYPE_TV,
CONFIG_RENDER_TYPE_END
};
+enum {
+ CONFIG_RENDER_PLATFORM_OPENGL_MAIN = 0,
+ CONFIG_RENDER_PLATFORM_OPENGL_CORE = 1,
+ CONFIG_RENDER_PLATFORM_OPENGL_ES = 2,
+ CONFIG_RENDER_PLATFORM_QT3D = 8,
+ CONFIG_RENDER_PLATFORM_VULKAN = 16,
+ CONFIG_RENDER_PLATFORM_DIRECTDRAW = 24,
+ CONFIG_RENDER_PLATFORM_SDLFB = 25,
+ CONFIG_RENDER_PLATFORM_DIRECTX = 32,
+};
#define MAX_HISTORY 8
int opengl_filter_num;
bool swap_kanji_pause;
+ /*
+ * TYPE :
+ * 0 : OpenGL/Main Profile
+ * 1 : OpenGL/Core Profile
+ * 2 : OpenGL ES
+ * 8 : Qt3D(Will not implement)
+ * 16 : Vulkan (Will not implement)
+ * 24 : DirectDraw (Will not implement)
+ * 25 : SDLFB(Will not implement)
+ * 32 : DirectX(Will not implement)
+ */
+ int render_platform;
+ int render_major_version;
+ int render_minor_version;
#endif
// sound
)
set_target_properties(CSPosd PROPERTIES
- SOVERSION 2.5.2
- VERSION 2.5.2
+ SOVERSION 2.5.3
+ VERSION 2.5.3
)
INSTALL(TARGETS CSPosd DESTINATION ${LIBCSP_INSTALL_DIR})
endif()
)
set_target_properties(CSPavio PROPERTIES
- SOVERSION 2.5.2
- VERSION 2.5.2
+ SOVERSION 2.5.3
+ VERSION 2.5.3
)
INSTALL(TARGETS CSPavio DESTINATION ${LIBCSP_INSTALL_DIR})
endif()
)
set_target_properties(CSPemu_utils PROPERTIES
- SOVERSION 2.2.1
- VERSION 2.2.1
+ SOVERSION 2.2.2
+ VERSION 2.2.2
)
INSTALL(TARGETS CSPemu_utils DESTINATION ${LIBCSP_INSTALL_DIR})
endif()
)
set_target_properties(CSPgui PROPERTIES
- SOVERSION 2.4.2
- VERSION 2.4.2
+ SOVERSION 2.4.3
+ VERSION 2.4.3
)
INSTALL(TARGETS CSPgui DESTINATION ${LIBCSP_INSTALL_DIR})
endif()
void on_recent_cart(void);
void do_save_as_movie(void);
void do_stop_saving_movie(void);
-
+
signals:
int on_boot_mode(int);
int on_cpu_type(int);
void do_send_string(void);
void do_set_string(QString);
void do_set_dev_log_to_console(bool f);
+ void do_select_render_platform(void);
signals:
int quit_emu_thread(void);
int sig_send_string(QString);
int sig_set_dev_log_to_console(int, bool);
+ int sig_select_render_platform(int);
} ActionControl;
QT_END_NAMESPACE
<context>
<name>CSP_DropDownJoysticks</name>
<message>
- <location filename="menu_main.cpp" line="787"/>
+ <location filename="menu_main.cpp" line="893"/>
<source>Configure Joysticks</source>
<translation>ジョイステックを設定する</translation>
</message>
<translation>*未定義*</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="801"/>
+ <location filename="menu_main.cpp" line="907"/>
<source>Configure Keyboard</source>
<translation>キーボードの設定</translation>
</message>
<translation>レーザディスク</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="617"/>
+ <location filename="menu_main.cpp" line="674"/>
<source>Configure Joysticks</source>
<translation>ジョイスティックの設定</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="618"/>
+ <location filename="menu_main.cpp" line="675"/>
<source>Configure assigning buttons/directions of joysticks.</source>
<translation>ジョイスティックの方向やボタンの割当を設定します。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="622"/>
+ <location filename="menu_main.cpp" line="679"/>
<source>ROMA-KANA Conversion</source>
<translation>ローマ字かな変換</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="623"/>
+ <location filename="menu_main.cpp" line="680"/>
<source>Use romaji-kana conversion assistant of emulator.</source>
<translation>エミュレータ上のローマ字かな変換を使用します。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="625"/>
+ <location filename="menu_main.cpp" line="682"/>
<source>Emulator</source>
<translation>エミュレータ</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="626"/>
+ <location filename="menu_main.cpp" line="683"/>
<source>Configure Keyboard</source>
<translation>キーボード設定</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="627"/>
+ <location filename="menu_main.cpp" line="684"/>
<source>Set addignation of keyboard.</source>
<translation>キーの割当を設定します。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="629"/>
+ <location filename="menu_main.cpp" line="686"/>
<source>Configure movie encoding</source>
<translation>動画保存設定</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="630"/>
+ <location filename="menu_main.cpp" line="687"/>
<source>Configure parameters of movie encoding.</source>
<translation>動画保存での、エンコーディングのパラメータを設定します。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="632"/>
+ <location filename="menu_main.cpp" line="689"/>
<source>Log to Console</source>
<translation>コンソールに記録</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="633"/>
+ <location filename="menu_main.cpp" line="690"/>
<source>Enable logging to STDOUT if checked.</source>
<translation>チェックすると、標準出力にログが出ます。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="634"/>
+ <location filename="menu_main.cpp" line="691"/>
<source>Log to Syslog</source>
<translation>SYSLOGに記録</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="635"/>
+ <location filename="menu_main.cpp" line="692"/>
<source>Enable logging to SYSTEM log.
May be having permission to system and using *nix OS.</source>
<translation>ホストのシステムログにログを記録します。
つ*nix OSでないと使えないかもしれません。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="639"/>
+ <location filename="menu_main.cpp" line="696"/>
<source>Sound FDD Seek</source>
<translation>FDシーク音を鳴らす</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="640"/>
+ <location filename="menu_main.cpp" line="697"/>
<source>Enable FDD HEAD seeking sound.
Needs sound file.
See HELP->READMEs->Bios and Key assigns</source>
ヘルプのREADMEsの「BIOSとキー割り当て」項目をお読み下さい</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="643"/>
+ <location filename="menu_main.cpp" line="700"/>
<source>Sound CMT Relay</source>
<translation>レコーダのリレー音を鳴らす</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="644"/>
+ <location filename="menu_main.cpp" line="701"/>
<source>Enable CMT relay's sound.
Needs sound file.
See HELP->READMEs->Bios and Key assigns</source>
ヘルプのREADMEsの「BIOSとキー割り当て」項目をお読み下さい</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="647"/>
+ <location filename="menu_main.cpp" line="704"/>
<source>Sound CMT Buttons</source>
<translation>ボタン音を鳴らす</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="648"/>
+ <location filename="menu_main.cpp" line="705"/>
<source>Enable CMT button's sound.
Needs sound file.
See HELP->READMEs->Bios and Key assigns</source>
ヘルプのREADMEsの「BIOSとキー割り当て」項目をお読み下さい</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="651"/>
+ <location filename="menu_main.cpp" line="708"/>
<source>Per Device</source>
<translation>デバイスごと</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="653"/>
+ <location filename="menu_main.cpp" line="710"/>
+ <source>Video Platform(need restart)</source>
+ <translation>表示基盤(要再起動)</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="711"/>
+ <source>OpenGLv3.0</source>
+ <translation>OpenGL v3.0</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="712"/>
+ <source>OpenGLv2.0</source>
+ <translation>OpenGL v2.0</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="713"/>
+ <source>OpenGL(Core profile)</source>
+ <translation>OpenGL(Core Profile)</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="714"/>
+ <source>Using OpenGL v3.0(MAIN).
+This is recommanded.
+If changed, need to restart this emulator.</source>
+ <translation>OpenGLv3.0(メインプロファイル)で描画します。
+これを推奨します。
+変更した場合は、エミュレータの再起動が必要です。</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="715"/>
+ <source>Using OpenGLv2.
+This is fallback of some systems.
+If changed, need to restart this emulator.</source>
+ <translation>OpenGLv2.0で描画します。
+機能が劣りますが、幾つかのシステムでは代用とし
+て、これが選択されるでしょう。
+変更した場合は、エミュレータの再起動が必要です。</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="716"/>
+ <source>Using OpenGL core profile.
+This still not implement.
+If changed, need to restart this emulator.</source>
+ <translation>OpenGLのCore Profileを使用します。
+まだ、実装されていません。
+変更した場合は、エミュレータの再起動が必要です。</translation>
+ </message>
+ <message>
+ <location filename="menu_main.cpp" line="718"/>
<source>View Log</source>
<translation>ログを見る</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="654"/>
+ <location filename="menu_main.cpp" line="719"/>
<source>View emulator logs with a dialog.</source>
<translation>エミュレータのログを、ダイアログで見ます。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="808"/>
+ <location filename="menu_main.cpp" line="914"/>
<source>Help</source>
<translation>ヘルプ</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="809"/>
+ <location filename="menu_main.cpp" line="915"/>
<source>About Qt</source>
<translation>Qtについて</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="810"/>
+ <location filename="menu_main.cpp" line="916"/>
<source>Display Qt version.</source>
<translation>Qtのヴァージョンを表示します。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="813"/>
+ <location filename="menu_main.cpp" line="919"/>
<source>About...</source>
<translation>このソフトについて...</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="815"/>
+ <location filename="menu_main.cpp" line="921"/>
<source>About this emulator.</source>
<translation>このエミュレータについて。
クレジット表記などです。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="817"/>
+ <location filename="menu_main.cpp" line="923"/>
<source>READMEs</source>
<translation>READMEs</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="819"/>
+ <location filename="menu_main.cpp" line="925"/>
<source>General Document</source>
<translation>総合的な文書</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="820"/>
+ <location filename="menu_main.cpp" line="926"/>
<source>About Qt ports</source>
<translation>Qt移植版について(英語)</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="821"/>
+ <location filename="menu_main.cpp" line="927"/>
<source>About Qt ports (Japanese).</source>
<translation>Qt移植版について(日本語)。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="822"/>
+ <location filename="menu_main.cpp" line="928"/>
<source>By Mr. tanam</source>
<translation>Tanamさんによる文書</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="823"/>
+ <location filename="menu_main.cpp" line="929"/>
<source>About eFM-7/8/77/AV.</source>
<translation>eFM-7/8/77/AVについて。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="824"/>
+ <location filename="menu_main.cpp" line="930"/>
<source>About eFM-7/8/77/AV (Japanese).</source>
<translation>eFM-7/8/77/AVについて(日本語)。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="825"/>
+ <location filename="menu_main.cpp" line="931"/>
<source>FAQs(English)</source>
<translation>FAQs(英語)</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="826"/>
+ <location filename="menu_main.cpp" line="932"/>
<source>FAQs(Japanese)</source>
<translation>FAQs(日本語)</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="827"/>
+ <location filename="menu_main.cpp" line="933"/>
<source>BIOS and Key assigns</source>
<translation>BIOSとキー割り当てについて</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="829"/>
+ <location filename="menu_main.cpp" line="935"/>
<source>Histories</source>
<translation>履歴・歴史</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="830"/>
+ <location filename="menu_main.cpp" line="936"/>
<source>General History</source>
<translation>全体の歴史</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="831"/>
+ <location filename="menu_main.cpp" line="937"/>
<source>Release Note</source>
<translation>リリースノート</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="832"/>
+ <location filename="menu_main.cpp" line="938"/>
<source>Change Log</source>
<translation>チェンジログ</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="833"/>
+ <location filename="menu_main.cpp" line="939"/>
<source>History by Tanam</source>
<translation>Tanamさん部分の履歴</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="835"/>
+ <location filename="menu_main.cpp" line="941"/>
<source>Show License</source>
<translation>ライセンス</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="836"/>
+ <location filename="menu_main.cpp" line="942"/>
<source>Show general license (GPLv2).</source>
<translation>ライセンスを読みます。GPL2です。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="837"/>
+ <location filename="menu_main.cpp" line="943"/>
<source>Show License (Japanese)</source>
<translation>ライセンス(日本語)</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="838"/>
+ <location filename="menu_main.cpp" line="944"/>
<source>Show general license (GPLv2).
Translated to Japanese.</source>
<translation>日本語に翻訳されたライセンスを読みます(GPL2)。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="849"/>
+ <location filename="menu_main.cpp" line="955"/>
<source>Machine</source>
<translation>仮想マシン</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="851"/>
+ <location filename="menu_main.cpp" line="957"/>
<source>Device Type</source>
<translation>デバイス</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="859"/>
+ <location filename="menu_main.cpp" line="965"/>
<source>Sound Cards</source>
<translation>サウンドカード</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="867"/>
+ <location filename="menu_main.cpp" line="973"/>
<source>Drive Type</source>
<translation>ドライブタイプ</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="875"/>
+ <location filename="menu_main.cpp" line="981"/>
<source>Printer (Need RESET)</source>
<translation>プリンタ(リセットが必要)</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="877"/>
+ <location filename="menu_main.cpp" line="983"/>
<source>Dump to File</source>
<translation>ファイルに書き込む</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="878"/>
+ <location filename="menu_main.cpp" line="984"/>
<source>Dump printer output to file.
Maybe output only ascii text.</source>
<translation>プリンタ出力をファイルに書き込みます。
書き込まれるのは、多分、アスキーテキストだけです。</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="882"/>
+ <location filename="menu_main.cpp" line="988"/>
<source>Printer</source>
<translation>プリンター</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="887"/>
+ <location filename="menu_main.cpp" line="993"/>
<source>Not Connect</source>
<translation>未接続</translation>
</message>
<message>
- <location filename="menu_main.cpp" line="888"/>
+ <location filename="menu_main.cpp" line="994"/>
<source>None devices connect to printer port.</source>
<translation>プリンタポートに何も繋がってない状態です。</translation>
</message>
CSP_MAINWIDGET_SAVE_MOVIE_END,
};
+#define MAX_RENDER_PLATFORMS 8
+
+enum {
+ RENDER_PLATFORMS_OPENGL3_MAIN = 0,
+ RENDER_PLATFORMS_OPENGL2_MAIN,
+ RENDER_PLATFORMS_OPENGL_CORE,
+ RENDER_PLATFORMS_END
+};
+
QT_BEGIN_NAMESPACE
class Ui_SoundDialog;
QMenu *menuLogToSyslog;
QMenu *menuDevLogToConsole;
QMenu *menuDevLogToSyslog;
+ QMenu *menu_SetRenderPlatform;
+
+ class Action_Control *action_SetRenderPlatform[MAX_RENDER_PLATFORMS];
+ QActionGroup *actionGroup_SetRenderPlatform;
class Action_Control *action_UseRomaKana;
class Action_Control *action_LogToSyslog;
void do_set_roma_kana(bool f);
void do_set_render_mode_std(void);
void do_set_render_mode_tv(void);
+ void do_select_render_platform(int num);
signals:
int message_changed(QString);
bindString = s;
}
+void Action_Control::do_select_render_platform(void)
+{
+ int num = this->binds->getValue1();
+ emit sig_select_render_platform(num);
+}
+
void Action_Control::do_set_dev_log_to_console(bool f)
{
int num = this->binds->getValue1();
using_flags->get_config_ptr()->dev_log_to_console[num][0] = f;
}
+void Ui_MainWindowBase::do_select_render_platform(int num)
+{
+ int _major = 0;
+ int _minor = 0;
+ int _type = -1;
+
+ switch(num) {
+ case RENDER_PLATFORMS_OPENGL3_MAIN:
+ _type = CONFIG_RENDER_PLATFORM_OPENGL_MAIN;
+ _major = 3;
+ _minor = 0;
+ break;
+ case RENDER_PLATFORMS_OPENGL2_MAIN:
+ _type = CONFIG_RENDER_PLATFORM_OPENGL_MAIN;
+ _major = 2;
+ _minor = 0;
+ break;
+ case RENDER_PLATFORMS_OPENGL_CORE:
+ _type = CONFIG_RENDER_PLATFORM_OPENGL_CORE;
+ _major = 3;
+ _minor = 2;
+ break;
+ default:
+ break;
+ }
+ if(_type >= 0) {
+ using_flags->get_config_ptr()->render_platform = _type;
+ using_flags->get_config_ptr()->render_major_version = _major;
+ using_flags->get_config_ptr()->render_minor_version = _minor;
+ }
+}
void Ui_MainWindowBase::setupUi(void)
{
{
#if defined(_USE_GLAPI_QT5_4)
QSurfaceFormat fmt;
- fmt.setProfile(QSurfaceFormat::CompatibilityProfile); // Requires >=Qt-4.8.0
#else
QGLFormat fmt;
- fmt.setProfile(QGLFormat::CompatibilityProfile); // Requires >=Qt-4.8.0
- //fmt.setProfile(QGLFormat::CoreProfile); // Requires >=Qt-4.8.0
- fmt.setVersion(3, 0);
#endif
+ {
+ int render_type = using_flags->get_config_ptr()->render_platform;
+ int _major_version = using_flags->get_config_ptr()->render_major_version;
+ int _minor_version = using_flags->get_config_ptr()->render_minor_version;
+#if defined(_USE_GLAPI_QT5_4)
+ if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
+ fmt.setProfile(QSurfaceFormat::CoreProfile); // Requires >=Qt-4.8.0
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL CORE profile.");
+ } else { // Fallback
+ fmt.setProfile(QSurfaceFormat::CompatibilityProfile); // Requires >=Qt-4.8.0
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL Compatible(MAIN) profile.");
+ }
+#else
+ if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
+ fmt.setProfile(QGLFormat::CoreProfile); // Requires >=Qt-4.8.0
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL CORE profile.");
+ fmt.setVersion(3, 2);
+ } else {
+ fmt.setProfile(QGLFormat::CompatibilityProfile); // Requires >=Qt-4.8.0
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use OpenGL Compatible(MAIN) profile.");
+ fmt.setVersion(3, 0);
+ }
+#endif
+ }
graphicsView = new GLDrawClass(using_flags, this, fmt);
graphicsView->setObjectName(QString::fromUtf8("graphicsView"));
graphicsView->setMaximumSize(2560, 2560); // ?
}
menuDevLogToConsole->setTitle(QApplication::translate("MainWindow", "Per Device", 0));
+ menu_SetRenderPlatform->setTitle(QApplication::translate("MainWindow", "Video Platform(need restart)", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL3_MAIN]->setText(QApplication::translate("MainWindow", "OpenGLv3.0", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL2_MAIN]->setText(QApplication::translate("MainWindow", "OpenGLv2.0", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL_CORE]->setText(QApplication::translate("MainWindow", "OpenGL(Core profile)", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL3_MAIN]->setToolTip(QApplication::translate("MainWindow", "Using OpenGL v3.0(MAIN).\nThis is recommanded.\nIf changed, need to restart this emulator.", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL2_MAIN]->setToolTip(QApplication::translate("MainWindow", "Using OpenGLv2.\nThis is fallback of some systems.\nIf changed, need to restart this emulator.", 0));
+ action_SetRenderPlatform[RENDER_PLATFORMS_OPENGL_CORE]->setToolTip(QApplication::translate("MainWindow", "Using OpenGL core profile.\nThis still not implement.\nIf changed, need to restart this emulator.", 0));
+
action_LogView->setText(QApplication::translate("MainWindow", "View Log", 0));
action_LogView->setToolTip(QApplication::translate("MainWindow", "View emulator logs with a dialog.", 0));
}
if(using_flags->is_use_sound_files_buttons()) menuEmulator->addAction(action_SoundFilesButtons);
menuEmulator->addSeparator();
}
+ menuEmulator->addAction(menu_SetRenderPlatform->menuAction());
+
if(using_flags->is_use_joystick()) {
menuEmulator->addAction(action_SetupJoystick);
}
action_LogView = new Action_Control(this, using_flags);
connect(action_LogView, SIGNAL(triggered()),
this, SLOT(rise_log_viewer()));
- //action_LogRecord = new Action_Control(this, using_flags);
- //action_LogRecord->setCheckable(true);
- //action_LogRecord->setEnabled(true);
- //if(using_flags->get_config_ptr()->log_recording == 0) action_LogRecord->setChecked(false);
+ menu_SetRenderPlatform = new QMenu(this);
+ menu_SetRenderPlatform->setToolTipsVisible(true);
+ actionGroup_SetRenderPlatform = new QActionGroup(this);
+ actionGroup_SetRenderPlatform->setExclusive(true);
+ {
+ int render_type = using_flags->get_config_ptr()->render_platform;
+ int _major_version = using_flags->get_config_ptr()->render_major_version;
+ int _minor_version = using_flags->get_config_ptr()->render_minor_version;
+ for(i = 0; i < MAX_RENDER_PLATFORMS; i++) {
+ tmps = QString::number(i);
+ action_SetRenderPlatform[i] = new Action_Control(this, using_flags);
+ action_SetRenderPlatform[i]->setObjectName(QString::fromUtf8("action_SetRenderPlatform", -1) + tmps);
+ action_SetRenderPlatform[i]->setCheckable(true);
+ action_SetRenderPlatform[i]->binds->setValue1(i);
+ actionGroup_SetRenderPlatform->addAction(action_SetRenderPlatform[i]);
+ menu_SetRenderPlatform->addAction(action_SetRenderPlatform[i]);
+ if(i >= RENDER_PLATFORMS_END) {
+ action_SetRenderPlatform[i]->setVisible(false);
+ } else {
+ if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_MAIN) {
+ if(_major_version >= 3) {
+ if(i == RENDER_PLATFORMS_OPENGL3_MAIN) {
+ action_SetRenderPlatform[i]->setChecked(true);
+ }
+ } else if(i == RENDER_PLATFORMS_OPENGL2_MAIN) {
+ action_SetRenderPlatform[i]->setChecked(true);
+ }
+ } else if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
+ if(i == RENDER_PLATFORMS_OPENGL_CORE) {
+ action_SetRenderPlatform[i]->setChecked(true);
+ }
+ }
+ if(i == RENDER_PLATFORMS_OPENGL_CORE) {
+ action_SetRenderPlatform[i]->setEnabled(false);
+ //action_SetRenderPlatform[i]->setCheckable(false);
+ }
+ }
+ connect(action_SetRenderPlatform[i], SIGNAL(triggered()),
+ action_SetRenderPlatform[i], SLOT(do_select_render_platform(void)));
+ connect(action_SetRenderPlatform[i], SIGNAL(sig_select_render_platform(int)),
+ this, SLOT(do_select_render_platform(int)));
+ }
+ }
action_SetupKeyboard = new Action_Control(this, using_flags);
action_SetupMovie = new Action_Control(this, using_flags);
void InitFBO(void);
void closeEvent(QCloseEvent *event);
void drawUpdateTexture(bitmap_t *p);
+ QString logGLString(bool getExtensions = false);
public slots:
void initKeyCode(void);
{
}
+QString GLDrawClass::logGLString(bool getExtensions)
+{
+ const GLubyte *(*glGetString)(GLenum);
+ QOpenGLContext *glContext = QOpenGLContext::currentContext();
+
+ QString s;
+ s.clear();
+ glGetString = (const GLubyte *(*)(GLenum))glContext->getProcAddress(QByteArray("glGetString"));
+ if(glGetString != NULL) {
+ s.append(QString::fromUtf8("\nSupported OpenGL Vendor: "));
+ s.append(QString::fromUtf8((const char *)glGetString(GL_VENDOR)));
+ s.append(QString::fromUtf8("\nSupported OpenGL Version: "));
+ s.append(QString::fromUtf8((const char *)glGetString(GL_VERSION)));
+ s.append(QString::fromUtf8("\nSupported OpenGL Shading Language Version: "));
+ s.append(QString::fromUtf8((const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)));
+ s.append(QString::fromUtf8("\nSupported OpenGL Renderer: "));
+ s.append(QString::fromUtf8((const char *)glGetString(GL_RENDERER)));
+ if(getExtensions) {
+ s.append(QString::fromUtf8("\nSupported OpenGL Extensions: "));
+ s.append(QString::fromUtf8((const char *)glGetString(GL_EXTENSIONS)));
+ }
+ }
+ return s;
+}
-
void GLDrawClass::InitFBO(void)
{
int i;
GLfloat xf, yf, delta;
QOpenGLContext *glContext = QOpenGLContext::currentContext();
- QOpenGLVersionProfile prof;
-
- // Try 4.x
- //prof.setProfile(QSurfaceFormat::CoreProfile);
-
- QOpenGLFunctions_2_0 *funcs_2_0 = glContext->versionFunctions<QOpenGLFunctions_2_0>();
+ int render_type = using_flags->get_config_ptr()->render_platform;
+ int _major_version = using_flags->get_config_ptr()->render_major_version;
+ int _minor_version = using_flags->get_config_ptr()->render_minor_version;
QSurfaceFormat _fmt = glContext->format();
- QOpenGLFunctions *funcs = glContext->functions();
+ QSurfaceFormat::RenderableType capability = _fmt.renderableType();
+ QString tmps = logGLString(false);
+
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "%s", tmps.toLocal8Bit().constData());
- QPair<int, int> _glversion = _fmt.version();
- if((_fmt.renderableType() & QSurfaceFormat::OpenGL) != 0) {
- if((_glversion.first == 3) && (_glversion.second <= 0) && (extfunc == NULL)){
+ if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_CORE) {
+ QPair<int, int> _glversion = _fmt.version();
+ if((((_glversion.first == 3) && (_glversion.second >= 2)) || (_glversion.first >= 4)) &&
+ (extfunc == NULL) &&
+ (((_major_version == 3) && (_minor_version >= 2)) || (_major_version >= 4))){
+ //extfunc = new GLDraw_3_0(this, using_flags); // ToDo
+ if(extfunc != NULL) {
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Use OpenGL v3.2(CORE) Renderer");
+ }
+ }
+ }
+
+ if(render_type == CONFIG_RENDER_PLATFORM_OPENGL_MAIN) {
+ QPair<int, int> _glversion = _fmt.version();
+ if((_glversion.first >= 3) && (_glversion.second >= 0) &&
+ (extfunc == NULL) &&
+ (_major_version >= 3)){
extfunc = new GLDraw_3_0(this, using_flags);
- csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Use OpenGL v3.0 Renderer");
- } else
- if((funcs_2_0 != NULL) && (extfunc == NULL)){
+ if(extfunc != NULL) {
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Use OpenGL v3.0 Renderer");
+ }
+ }
+ if(extfunc == NULL) { // Fallback
+ if((_major_version >= 3) || ((_major_version == 2) && (_minor_version >= 1))) {
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Try to use fallback: OpenGL 2.0");
+ }
extfunc = new GLDraw_2_0(this, using_flags);
- csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Use OpenGL v2.0 Renderer");
+ if(extfunc != NULL) {
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "Use OpenGL v2.0 Renderer");
+ }
}
}
- if(funcs != NULL) {
- csp_logger->debug_log(CSP_LOG_DEBUG, "Supported OpenGL Vendor %s", funcs->glGetString(GL_VENDOR));
- csp_logger->debug_log(CSP_LOG_DEBUG, "Supported OpenGL Version %s", funcs->glGetString(GL_VERSION));
- csp_logger->debug_log(CSP_LOG_DEBUG, "Supported OpenGL Shading Language Version %s", funcs->glGetString(GL_SHADING_LANGUAGE_VERSION));
- csp_logger->debug_log(CSP_LOG_DEBUG, "Supported OpenGL Renderer %s", funcs->glGetString(GL_RENDERER));
- //csp_logger->debug_log(CSP_LOG_DEBUG, "Supported OpenGL Extensions %s", funcs->glGetString(GL_EXTENSIONS));
- }
-
if(extfunc != NULL) {
extfunc->initGLObjects();
extfunc->initFBO();
extfunc->initLocalGLObjects();
} else {
- csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "None using OpenGL.");
+ csp_logger->debug_log(CSP_LOG_DEBUG, CSP_LOG_TYPE_GENERAL, "None using OpenGL.Sorry.");
}
}