mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Adapt render size to fit browser window.
This commit is contained in:
parent
73f6e73c51
commit
4b5a823d39
@ -5,7 +5,7 @@ CFLAGS += -sUSE_FREETYPE=1 -pthread
|
|||||||
CXXFLAGS := $(CFLAGS) -std=c++17
|
CXXFLAGS := $(CFLAGS) -std=c++17
|
||||||
DEFINES += -DIMGUI_ENABLE_FREETYPE -DIMGUI_IMPL_OPENGL_ES2
|
DEFINES += -DIMGUI_ENABLE_FREETYPE -DIMGUI_IMPL_OPENGL_ES2
|
||||||
INCLUDES := -I../../../imgui -I$(HOME)/.emscripten_cache/sysroot/include/capstone
|
INCLUDES := -I../../../imgui -I$(HOME)/.emscripten_cache/sysroot/include/capstone
|
||||||
LIBS += -lpthread -ldl $(HOME)/.emscripten_cache/sysroot/lib/libcapstone.a -sUSE_GLFW=3 -sTOTAL_MEMORY=512mb -sWASM_BIGINT=1 -sPTHREAD_POOL_SIZE=4 --preload-file embed.tracy
|
LIBS += -lpthread -ldl $(HOME)/.emscripten_cache/sysroot/lib/libcapstone.a -sUSE_GLFW=3 -sTOTAL_MEMORY=512mb -sWASM_BIGINT=1 -sPTHREAD_POOL_SIZE=4 -sEXPORTED_FUNCTIONS=_main,_nativeResize -sEXPORTED_RUNTIME_METHODS=ccall --preload-file embed.tracy
|
||||||
|
|
||||||
PROJECT := Tracy
|
PROJECT := Tracy
|
||||||
IMAGE := $(PROJECT)-$(BUILD).html
|
IMAGE := $(PROJECT)-$(BUILD).html
|
||||||
|
@ -90,6 +90,10 @@
|
|||||||
var preloadElement = document.getElementById('preload');
|
var preloadElement = document.getElementById('preload');
|
||||||
var canvasElement = document.getElementById('canvas');
|
var canvasElement = document.getElementById('canvas');
|
||||||
|
|
||||||
|
function resizeHandler() {
|
||||||
|
Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth, window.innerHeight]);
|
||||||
|
}
|
||||||
|
|
||||||
var Module = {
|
var Module = {
|
||||||
preRun: [],
|
preRun: [],
|
||||||
postRun: [],
|
postRun: [],
|
||||||
@ -129,11 +133,10 @@
|
|||||||
progressElement.max = null;
|
progressElement.max = null;
|
||||||
progressElement.hidden = true;
|
progressElement.hidden = true;
|
||||||
preloadElement.hidden = true;
|
preloadElement.hidden = true;
|
||||||
if (!text) spinnerElement.style.display = 'none';
|
if (!text) {
|
||||||
/*
|
spinnerElement.style.display = 'none';
|
||||||
canvasElement.width = window.innerWidth;
|
resizeHandler();
|
||||||
canvasElement.height = window.innerHeight;
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
statusElement.innerHTML = text;
|
statusElement.innerHTML = text;
|
||||||
},
|
},
|
||||||
@ -152,15 +155,8 @@
|
|||||||
if (text) console.error('[post-exception status] ' + text);
|
if (text) console.error('[post-exception status] ' + text);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/*
|
addEventListener('resize', resizeHandler);
|
||||||
addEventListener('resize', (event) => {
|
|
||||||
canvasElement.width = window.innerWidth;
|
|
||||||
canvasElement.height = window.innerHeight;
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
</script>
|
</script>
|
||||||
<script async type="text/javascript" src="Tracy-release.js"></script>
|
<script async type="text/javascript" src="Tracy-release.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,3 +199,11 @@ float Backend::GetDpiScale()
|
|||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
extern "C" int nativeResize( int width, int height )
|
||||||
|
{
|
||||||
|
glfwSetWindowSize( s_window, width, height );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user