Can't change window name in code
Monkey Targets Forums/Desktop/Can't change window name in code
| ||
I tried to change the window title with this compiler directive which I put right at the top of my main file: #GLFW_WINDOW_TITLE="DyingToLive" But it fails to compile with: ** BUILD FAILED ** The following build commands failed: CompileC build/MonkeyGame.build/Debug/MonkeyGame.build/Objects-normal/x86_64/main.o ../main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure) TRANS FAILED: TRANS Failed to execute 'xcodebuild -configuration Debug', return code=16640 The docs for the config file seem to indicate that this should be possible. I don't want to have to edit the config file to change the window name (this works fine btw) when I should be able to set it in code like the old AppTitle command in BlitzMax. I tried deleting the build folder but it has the same result. |
| ||
I'm having a problem with this as well (I tried to name the window "Test", but my error is:Build FAILED. "D:\Development\MyProjects\Monkey\mutated-monkey\wdw\framework\test\integration_tests\simpele_game.build\glfw\vc2010\MonkeyGame.sln" (default target) (1) -> "D:\Development\MyProjects\Monkey\mutated-monkey\wdw\framework\test\integration_tests\simpele_game.build\glfw\vc2010\MonkeyGame.vcxproj" (default target) (2) -> (ClCompile target) -> ..\main.cpp(4425): error C2065: 'Test' : undeclared identifier [D:\Development\MyProjects\Monkey\mutated-monkey\wdw\framework\test\integration_tests\simpele_game.build\glfw\vc2010\MonkeyGame.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:04.45 TRANS FAILED: TRANS Failed to execute 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Debug;Platform="win32" MonkeyGame.sln', return code=1 Abnormal program termination. Exit code: -1 |
| ||
The reason why your getting this is because monkey doesn't add the quotes in the main.cpp when it's generated. So you have to use the escape sequence for quotes. #GLFW_WINDOW_TITLE="DyingToLive" needs to be #GLFW_WINDOW_TITLE="~qDyingToLive~q" I think it really needs to be mentioned in the manual. |
| ||
That was bugging me for a while. Thanks dawlane for the fix! |
| ||
@Amon:It's not really a fix just an omission from the Monkey documentation about dealing with those directives. You do the same thing when dealing with text and strings in C/C++. |