Single quotes in #GLFW_WINDOW_TITLE do not work

Monkey Targets Forums/Desktop/Single quotes in #GLFW_WINDOW_TITLE do not work

Soap(Posted 2013) [#1]
If you add escaped double quotes around it does work with a single quote inside. To make this work the most desirable way requires editing the target.

#GLFW_WINDOW_TITLE="~qA Monkey's Title~q"

Generates

#define CFG_GLFW_WINDOW_TITLE "A Monkey's Title"

Without the double quotes it of course implodes.

If you don't want double quotes around your window title then you can edit the target to include your proper title:

Find void BBGlfwGame::SetGlfwWindow

Change

glfwSetWindowTitle( _STRINGIZE("") );

To

glfwSetWindowTitle("A Monkey's Title");

And that should work.

But it would be better if single quotes in #GLFW_WINDOW_TITLE works without extra steps.


Ferdi(Posted 2013) [#2]
Try:

#GLFW_WINDOW_TITLE="A Monkey\047s Title"

Is that what you want?

If that is what you want and it is a good enough solution, you can find other characters at: http://donsnotes.com/tech/charsets/ascii.html.


dawlane(Posted 2013) [#3]
If your after single a single quote you can use the same escape sequence that you would for a C/C++ string ( \' or \047 just like what Ferdi has done) with the exception of a double quote ( " ) which you would still have to write as ~q.
It should be noted that not all of the C/C++ escapes will work e.g. \a will not produce a beep, but adds a garbled character.

Edit:
@Soap: Which version of Monkey are you using as #GLFW_WINDOW_TITLE="A Monkey's Title" works as it should with 73b on Linux.

Edit2:
OK it's a windows only problem with Visual Studio so far haven't test it with MinGW. Normal short hand escape sequences ( \' ) don't work so you have to use \047.


Soap(Posted 2013) [#4]
MonkeyPro74a, and neither \047, ', nor \' works with it for GLFW on Windows.


dawlane(Posted 2013) [#5]
It's definitely a Visual Studio thing.
Normal escape sequence \' or just ( ' ) throws a warning with MinGW but works.
Using \047 works here with vs2010 and a clean install of MonkeyPro74a.


Soap(Posted 2013) [#6]
Must be. I need to do a clean install of everything in the near future.