mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-12 08:04:09 +02:00
#15 WIN32 centering window and hide console for release build, add application icon
This commit is contained in:
BIN
src/platform/win/OpenLara.rc
Normal file
BIN
src/platform/win/OpenLara.rc
Normal file
Binary file not shown.
@@ -28,7 +28,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v141_xp</PlatformToolset>
|
||||||
<CharacterSet>NotSet</CharacterSet>
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Editor|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Editor|Win32'" Label="Configuration">
|
||||||
@@ -40,14 +40,14 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v141_xp</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>NotSet</CharacterSet>
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v141_xp</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>NotSet</CharacterSet>
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
@@ -237,6 +237,12 @@
|
|||||||
<None Include="..\..\shaders\shader.glsl" />
|
<None Include="..\..\shaders\shader.glsl" />
|
||||||
<None Include="..\..\shaders\water.glsl" />
|
<None Include="..\..\shaders\water.glsl" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="OpenLara.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="icon.ico" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
@@ -89,4 +89,10 @@
|
|||||||
<UniqueIdentifier>{80edb27c-40cf-4f7a-a854-88eeba24a5fb}</UniqueIdentifier>
|
<UniqueIdentifier>{80edb27c-40cf-4f7a-a854-88eeba24a5fb}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="OpenLara.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="icon.ico" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@@ -1,18 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LocalDebuggerWorkingDirectory>..\..\..\bin</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>..\..\..\bin\TR1_PSX</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
|
||||||
<LocalDebuggerCommandArguments>GYM.PHD</LocalDebuggerCommandArguments>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
|
|
||||||
<LocalDebuggerWorkingDirectory>C:\Projects\OpenLara\bin\</LocalDebuggerWorkingDirectory>
|
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LocalDebuggerWorkingDirectory>C:\Projects\OpenLara\bin\TR3_PC</LocalDebuggerWorkingDirectory>
|
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
<LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>
|
||||||
</LocalDebuggerCommandArguments>
|
</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
|
||||||
|
<LocalDebuggerWorkingDirectory>..\..\..\bin\TR1_PSX</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LocalDebuggerWorkingDirectory>..\..\..\bin\TR1_PSX</LocalDebuggerWorkingDirectory>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerCommandArguments>PSXDATA/GYM.PSX</LocalDebuggerCommandArguments>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
BIN
src/platform/win/icon.ico
Normal file
BIN
src/platform/win/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@@ -731,10 +731,12 @@ int main(int argc, char** argv) {
|
|||||||
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
|
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
|
||||||
_CrtMemCheckpoint(&_msBegin);
|
_CrtMemCheckpoint(&_msBegin);
|
||||||
//#elif PROFILE
|
//#elif PROFILE
|
||||||
#else
|
#elif PROFILE
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
//#else
|
#else
|
||||||
//int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
||||||
|
int argc = lpCmdLine ? 2 : 1;
|
||||||
|
char *argv[] = { "", lpCmdLine };
|
||||||
#endif
|
#endif
|
||||||
cacheDir[0] = saveDir[0] = contentDir[0] = 0;
|
cacheDir[0] = saveDir[0] = contentDir[0] = 0;
|
||||||
|
|
||||||
@@ -746,7 +748,23 @@ int main(int argc, char** argv) {
|
|||||||
RECT r = { 0, 0, 1280, 720 };
|
RECT r = { 0, 0, 1280, 720 };
|
||||||
AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW, false);
|
AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW, false);
|
||||||
|
|
||||||
hWnd = CreateWindow("static", "OpenLara", WS_OVERLAPPEDWINDOW, 0, 0, r.right - r.left, r.bottom - r.top, 0, 0, 0, 0);
|
#ifndef _DEBUG
|
||||||
|
{
|
||||||
|
int ox = (GetSystemMetrics(SM_CXSCREEN) - (r.right - r.left)) / 2;
|
||||||
|
int oy = (GetSystemMetrics(SM_CYSCREEN) - (r.bottom - r.top)) / 2;
|
||||||
|
r.left += ox;
|
||||||
|
r.top += oy;
|
||||||
|
r.right += ox;
|
||||||
|
r.bottom += oy;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
r.right += r.left;
|
||||||
|
r.bottom += r.top;
|
||||||
|
r.left = r.top = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
hWnd = CreateWindow("static", "OpenLara", WS_OVERLAPPEDWINDOW, r.left, r.top, r.right - r.left, r.bottom - r.top, 0, 0, 0, 0);
|
||||||
|
SendMessage(hWnd, WM_SETICON, 1, (LPARAM)LoadIcon(GetModuleHandle(NULL), "MAINICON"));
|
||||||
|
|
||||||
ContextCreate();
|
ContextCreate();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user