Include game icon in executable and game window (such a PITA)

pull/28/head
sigonasr2 1 year ago
parent c81040494c
commit d099bdde84
  1. 57
      Crawler/Crawler.rc
  2. 8
      Crawler/Crawler.vcxproj
  3. 21
      Crawler/Crawler.vcxproj.filters
  4. BIN
      Crawler/RCa12948
  5. BIN
      Crawler/assets/heart.ico
  6. 6
      Crawler/olcPixelGameEngine.h
  7. 16
      Crawler/resource.h
  8. 17
      Crawler/resource1.h

@ -0,0 +1,57 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
MAINICON ICON "assets\\heart.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

@ -144,6 +144,8 @@
<ClInclude Include="olcUTIL_Camera2D.h" /> <ClInclude Include="olcUTIL_Camera2D.h" />
<ClInclude Include="olcUTIL_Geometry2D.h" /> <ClInclude Include="olcUTIL_Geometry2D.h" />
<ClInclude Include="Player.h" /> <ClInclude Include="Player.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="resource1.h" />
<ClInclude Include="State.h" /> <ClInclude Include="State.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -165,6 +167,12 @@
<Text Include="NewClasses.txt" /> <Text Include="NewClasses.txt" />
<Text Include="InitialConcept.txt" /> <Text Include="InitialConcept.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="assets\heart.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Crawler.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

@ -9,10 +9,13 @@
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter> </Filter>
<Filter Include="Documentation"> <Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
<Filter Include="Documentation">
<UniqueIdentifier>{50277c8c-92cf-4eef-81ed-3e70ff51ec56}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="olcPixelGameEngine.h"> <ClInclude Include="olcPixelGameEngine.h">
@ -63,6 +66,12 @@
<ClInclude Include="Class.h"> <ClInclude Include="Class.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="resource1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Player.cpp"> <ClCompile Include="Player.cpp">
@ -107,4 +116,14 @@
<Filter>Documentation</Filter> <Filter>Documentation</Filter>
</Text> </Text>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="assets\heart.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Crawler.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project> </Project>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

@ -5414,7 +5414,11 @@ namespace olc
virtual olc::rcode CreateWindowPane(const olc::vi2d& vWindowPos, olc::vi2d& vWindowSize, bool bFullScreen) override virtual olc::rcode CreateWindowPane(const olc::vi2d& vWindowPos, olc::vi2d& vWindowSize, bool bFullScreen) override
{ {
WNDCLASS wc; WNDCLASS wc;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hIcon = static_cast<HICON>(::LoadImage(GetModuleHandle(nullptr),
MAKEINTRESOURCE(102),
IMAGE_ICON,
48, 48,
LR_DEFAULTCOLOR));;
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.hInstance = GetModuleHandle(nullptr); wc.hInstance = GetModuleHandle(nullptr);

@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Crawler.rc
//
#define MAINICON 102
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 103
#endif
#endif

@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Crawler1.rc
//
#define MAINICON 101
#define IDB_PNG1 102
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Loading…
Cancel
Save