Some random developer-oriented questions

Christopher Stawarz's Avatar

Christopher Stawarz

27 Jul, 2010 09:41 PM

Some questions from Mark:

  • XCode/Cocoa: If you make a change to the Core and recompile, do you need to recompile the Server too? My (basic) understanding is that the Server links to the Core framework instead of embedding it. Is that right?
  • MWorks setup_variables.xml specifies refresh_rate for the monitor. What does that do, and how does it interact with the refresh rate set in System Preferences -> Display?
  • Do I ever need to make an openGL call to swap the front and back buffers, or does MWorks do that automatically for me?
  • Is there a good way, in MWorks, to get the current display background color? Should I just use glGetPixels()?
  1. Support Staff 1 Posted by Christopher Sta... on 27 Jul, 2010 10:22 PM

    Christopher Stawarz's Avatar

    Hey Mark,

    If you make a change to the Core and recompile, do you need to recompile the Server too? My (basic) understanding is that the Server links to the Core framework instead of embedding it. Is that right?

    In general, no, you don't need to recompile the server. MWServer links dynamically to the MWorksCore framework, so usually all you need to do is restart it.

    The exception is when you modify core header files that get included in the MWServer source (e.g. anything pulled in via Server.h). In that case, you should recompile the server. In practice, though, you probably don't need to worry about it.

    MWorks setup_variables.xml specifies refresh_rate for the monitor. What does that do, and how does it interact with the refresh rate set in System Preferences -> Display?

    In MWorks 0.4.4 (and earlier, I presume), the refresh_rate_hz setting was used when creating the main display's OpenGL context. If it didn't match the actual refresh rate, MWorks would generate an error message.

    As of the latest HEAD, it appears that the parameter is completely unused (although MWorks will still warn if it's missing).

    Do I ever need to make an openGL call to swap the front and back buffers, or does MWorks do that automatically for me?

    MWorks takes care of swapping the buffers.

    Is there a good way, in MWorks, to get the current display background color? Should I just use glGetPixels()?

    This should do the trick:

    GLfloat clearColor[4];
    glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
    //fprintf(stderr, "red = %g, green = %g, blue = %g, alpha = %g\n",
    //        clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
    

    Chris

  2. Christopher Stawarz closed this discussion on 04 Aug, 2010 03:06 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 May, 2022 02:12 PM
16 May, 2022 03:12 PM
04 May, 2022 06:02 PM
03 May, 2022 01:30 PM
02 May, 2022 10:47 PM