mirror of https://github.com/buggins/dlangui.git
more logging to investigate crash on dmd x86_64 release build
This commit is contained in:
parent
77a1793761
commit
6411f2adde
|
@ -72,7 +72,7 @@
|
||||||
<debuglevel>0</debuglevel>
|
<debuglevel>0</debuglevel>
|
||||||
<debugids>DebugFocus FontResources</debugids>
|
<debugids>DebugFocus FontResources</debugids>
|
||||||
<versionlevel>0</versionlevel>
|
<versionlevel>0</versionlevel>
|
||||||
<versionids>EmbedStandardResources Unicode USE_FREETYPE USE_OPENGL USE_SDL</versionids>
|
<versionids>EmbedStandardResources Unicode USE_FREETYPE USE_OPENGL</versionids>
|
||||||
<dump_source>0</dump_source>
|
<dump_source>0</dump_source>
|
||||||
<mapverbosity>0</mapverbosity>
|
<mapverbosity>0</mapverbosity>
|
||||||
<createImplib>1</createImplib>
|
<createImplib>1</createImplib>
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
<debuglevel>0</debuglevel>
|
<debuglevel>0</debuglevel>
|
||||||
<debugids />
|
<debugids />
|
||||||
<versionlevel>0</versionlevel>
|
<versionlevel>0</versionlevel>
|
||||||
<versionids>Unicode USE_FREETYPE USE_SDL</versionids>
|
<versionids>Unicode USE_FREETYPE</versionids>
|
||||||
<dump_source>0</dump_source>
|
<dump_source>0</dump_source>
|
||||||
<mapverbosity>0</mapverbosity>
|
<mapverbosity>0</mapverbosity>
|
||||||
<createImplib>0</createImplib>
|
<createImplib>0</createImplib>
|
||||||
|
|
|
@ -187,6 +187,10 @@ enum : int {
|
||||||
|
|
||||||
/// entry point for dlangui based application
|
/// entry point for dlangui based application
|
||||||
extern (C) int UIAppMain(string[] args) {
|
extern (C) int UIAppMain(string[] args) {
|
||||||
|
|
||||||
|
// always use trace, even for release builds
|
||||||
|
Log.setLogLevel(LogLevel.Trace);
|
||||||
|
|
||||||
// resource directory search paths
|
// resource directory search paths
|
||||||
// not required if only embedded resources are used
|
// not required if only embedded resources are used
|
||||||
//string[] resourceDirs = [
|
//string[] resourceDirs = [
|
||||||
|
|
|
@ -164,14 +164,21 @@ class GLProgram {
|
||||||
Log.d("Program compiled successfully");
|
Log.d("Program compiled successfully");
|
||||||
//glDetachShader(program, vertexShader);
|
//glDetachShader(program, vertexShader);
|
||||||
//glDetachShader(program, fragmentShader);
|
//glDetachShader(program, fragmentShader);
|
||||||
|
Log.v("trying glUseProgram(0)");
|
||||||
|
glUseProgram(0);
|
||||||
|
Log.v("before useProgram");
|
||||||
glUseProgram(program);
|
glUseProgram(program);
|
||||||
checkError("glUseProgram " ~ to!string(program));
|
checkError("glUseProgram " ~ to!string(program));
|
||||||
|
Log.v("after useProgram");
|
||||||
if (!initLocations()) {
|
if (!initLocations()) {
|
||||||
Log.e("some of locations were not found");
|
Log.e("some of locations were not found");
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
initialized = true;
|
initialized = true;
|
||||||
return true;
|
Log.v("Program is initialized successfully");
|
||||||
|
glUseProgram(0);
|
||||||
|
checkError("glUseProgram " ~ to!string(program));
|
||||||
|
return !error;
|
||||||
}
|
}
|
||||||
bool initLocations() {
|
bool initLocations() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -605,27 +612,34 @@ class GLSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool initShaders() {
|
bool initShaders() {
|
||||||
|
if (_solidFillProgram is null) {
|
||||||
|
Log.v("Compiling solid fill program");
|
||||||
|
_solidFillProgram = new SolidFillProgram();
|
||||||
|
if (!_solidFillProgram.compile())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (_textureProgram is null) {
|
if (_textureProgram is null) {
|
||||||
|
Log.v("Compiling texture program");
|
||||||
_textureProgram = new TextureProgram();
|
_textureProgram = new TextureProgram();
|
||||||
if (!_textureProgram.compile())
|
if (!_textureProgram.compile())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_fontProgram is null) {
|
if (_fontProgram is null) {
|
||||||
|
Log.v("Compiling font program");
|
||||||
_fontProgram = new FontProgram();
|
_fontProgram = new FontProgram();
|
||||||
if (!_fontProgram.compile())
|
if (!_fontProgram.compile())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_solidFillProgram is null) {
|
|
||||||
_solidFillProgram = new SolidFillProgram();
|
|
||||||
if (!_solidFillProgram.compile())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Log.d("Shaders compiled successfully");
|
Log.d("Shaders compiled successfully");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool uninitShaders() {
|
bool uninitShaders() {
|
||||||
Log.d("Uniniting shaders");
|
Log.d("Uniniting shaders");
|
||||||
|
if (_solidFillProgram !is null) {
|
||||||
|
destroy(_solidFillProgram);
|
||||||
|
_solidFillProgram = null;
|
||||||
|
}
|
||||||
if (_textureProgram !is null) {
|
if (_textureProgram !is null) {
|
||||||
destroy(_textureProgram);
|
destroy(_textureProgram);
|
||||||
_textureProgram = null;
|
_textureProgram = null;
|
||||||
|
@ -634,10 +648,6 @@ class GLSupport {
|
||||||
destroy(_fontProgram);
|
destroy(_fontProgram);
|
||||||
_fontProgram = null;
|
_fontProgram = null;
|
||||||
}
|
}
|
||||||
if (_solidFillProgram !is null) {
|
|
||||||
destroy(_solidFillProgram);
|
|
||||||
_solidFillProgram = null;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,14 +222,20 @@ class Win32Window : Window {
|
||||||
|
|
||||||
version (USE_OPENGL) {
|
version (USE_OPENGL) {
|
||||||
//_gl = new GLSupport();
|
//_gl = new GLSupport();
|
||||||
if (!_glSupport)
|
if (!_glSupport) {
|
||||||
|
Log.v("Creating OpenGL support");
|
||||||
_glSupport = new GLSupport();
|
_glSupport = new GLSupport();
|
||||||
|
Log.v("OpenGL support created");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// successful
|
// successful
|
||||||
|
Log.v("initializing shaders");
|
||||||
if (glSupport.valid || glSupport.initShaders()) {
|
if (glSupport.valid || glSupport.initShaders()) {
|
||||||
|
Log.v("shaders are ok");
|
||||||
setOpenglEnabled();
|
setOpenglEnabled();
|
||||||
useOpengl = true;
|
useOpengl = true;
|
||||||
|
Log.v("OpenGL is initialized ok");
|
||||||
} else {
|
} else {
|
||||||
Log.e("Failed to compile shaders");
|
Log.e("Failed to compile shaders");
|
||||||
}
|
}
|
||||||
|
@ -773,10 +779,12 @@ class Win32Platform : Platform {
|
||||||
private Win32Window[ulong] _windowMap;
|
private Win32Window[ulong] _windowMap;
|
||||||
/// add window to window map
|
/// add window to window map
|
||||||
void onWindowCreated(HWND hwnd, Win32Window window) {
|
void onWindowCreated(HWND hwnd, Win32Window window) {
|
||||||
|
Log.v("created window, adding to map");
|
||||||
_windowMap[cast(ulong)hwnd] = window;
|
_windowMap[cast(ulong)hwnd] = window;
|
||||||
}
|
}
|
||||||
/// remove window from window map, returns true if there are some more windows left in map
|
/// remove window from window map, returns true if there are some more windows left in map
|
||||||
bool onWindowDestroyed(HWND hwnd, Win32Window window) {
|
bool onWindowDestroyed(HWND hwnd, Win32Window window) {
|
||||||
|
Log.v("destroyed window, removing from map");
|
||||||
Win32Window wnd = getWindow(hwnd);
|
Win32Window wnd = getWindow(hwnd);
|
||||||
if (wnd) {
|
if (wnd) {
|
||||||
_windowMap.remove(cast(ulong)hwnd);
|
_windowMap.remove(cast(ulong)hwnd);
|
||||||
|
|
Loading…
Reference in New Issue