Added icons and fixed audio manger crash

This commit is contained in:
Antoine Pilote
2023-04-04 01:39:23 -04:00
parent 6b018aeb32
commit 0ba492a872
8 changed files with 82 additions and 5 deletions

60
Editor/Editor.rc Normal file
View File

@@ -0,0 +1,60 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource1.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource1.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

View File

@@ -0,0 +1 @@
appIcon ICON "nuake-logo.ico"

View File

@@ -1479,6 +1479,7 @@ namespace Nuake {
if (m_ShowImGuiDemo)
ImGui::ShowDemoWindow();
/*
if (ImGui::Begin("Toolbar", 0, ImGuiWindowFlags_NoScrollbar | ImGuiDockNodeFlags_AutoHideTabBar | ImGuiWindowFlags_NoDecoration))
{
float availWidth = ImGui::GetContentRegionAvailWidth();
@@ -1506,6 +1507,7 @@ namespace Nuake {
}
}
ImGui::End();
*/
}
void EditorInterface::Update(float ts)

View File

@@ -15,6 +15,15 @@ namespace Nuake
_audioThread = std::thread(&AudioManager::AudioThreadLoop, this);
}
AudioManager::~AudioManager()
{
Deinitialize();
_audioThreadRunning = false;
_audioThread.join();
}
void AudioManager::Deinitialize()
{
_soloud->deinit();
@@ -27,9 +36,6 @@ namespace Nuake
void AudioManager::AudioThreadLoop()
{
SoLoud::Speech speech;
speech.setText("Nuake");
_soloud->play(speech);
while(_audioThreadRunning)
{

View File

@@ -25,7 +25,7 @@ namespace Nuake
const int MAX_VOICE_COUNT = 32;
public:
AudioManager() = default;
~AudioManager() = default;
~AudioManager();
static AudioManager& Get()
{

View File

@@ -115,12 +115,18 @@ namespace Nuake {
{ // Create window
m_Window = glfwCreateWindow(m_Width, m_Height, m_Title.c_str(), NULL, NULL);
if (!m_Window)
{
Logger::Log("Window creation failed.", CRITICAL);
return -1;
}
GLFWimage images[1];
images[0].pixels = stbi_load("resources/Images/nuake-logo.png", &images[0].width, &images[0].height, 0, 4); //rgba channels
glfwSetWindowIcon(m_Window, 1, images);
stbi_image_free(images[0].pixels);
glfwMakeContextCurrent(m_Window);
Logger::Log((char*)glGetString(GL_VERSION));

View File

@@ -93,7 +93,9 @@ project "Editor"
files
{
"%{prj.name}/**.h",
"%{prj.name}/**.cpp"
"%{prj.name}/**.cpp",
"%{prj.name}/resources/*.rc",
"%{prj.name}/resources/**.ico"
}
includedirs