Documentation work.

This commit is contained in:
Camilla Berglund 2013-06-05 21:26:40 +02:00
parent 5fd409b679
commit fbfbf3ce07
3 changed files with 19 additions and 12 deletions

View File

@ -96,8 +96,8 @@ easier to integrate GLFW into C++ code.
@subsection news_30_iconifyfun Window iconification callback @subsection news_30_iconifyfun Window iconification callback
Each window object has a callback for iconification and restoration events, which is Each window object has a callback for iconification and restoration events,
set with @ref glfwSetWindowIconifyCallback. which is set with @ref glfwSetWindowIconifyCallback.
@subsection news_30_wndposfun Window position callback @subsection news_30_wndposfun Window position callback

View File

@ -197,14 +197,21 @@ for example pressing the escape key.
@section quick_render Rendering with OpenGL @section quick_render Rendering with OpenGL
Once you have a current OpenGL context, you can use OpenGL normally. In this Once you have a current OpenGL context, you can use OpenGL normally. In this
tutorial, a multi-colored rotating triangle will be rendered. The window size, tutorial, a multi-colored rotating triangle will be rendered. The framebuffer
needed here by `glViewport` and `glOrtho`, is retrieved using @ref size, needed by this example for `glViewport` and `glOrtho`, is retrieved with
glfwGetWindowSize. However, if you only need it for updating the viewport when @ref glfwGetFramebufferSize.
the window size changes, you can set a window size callback using @ref
glfwSetWindowSizeCallback and call `glViewport` from there.
@code @code
void window_size_callback(GLFWwindow* window, int width, int height) int width, height;
glfwGetFramebufferSize(window, &width, &height);
glViewport(0, 0, width, height);
@endcode
However, you can also set a framebuffer size callback using @ref
glfwSetFramebufferSizeCallback and call `glViewport` from there.
@code
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{ {
glViewport(0, 0, width, height); glViewport(0, 0, width, height);
} }

View File

@ -327,12 +327,12 @@ currently iconified, whether by the user or with @ref glfwIconifyWindow.
The `GLFW_VISIBLE` attribute indicates whether the specified window is currently The `GLFW_VISIBLE` attribute indicates whether the specified window is currently
visible. Window visibility can be controlled with @ref glfwShowWindow and @ref visible. Window visibility can be controlled with @ref glfwShowWindow and @ref
glfwHideWindow and initial visibility is controlled by the [window hint](@ref glfwHideWindow and initial visibility is controlled by the
window_hints) with the same name. [window hint](@ref window_hints) with the same name.
The `GLFW_RESIZABLE` attribute indicates whether the specified window is The `GLFW_RESIZABLE` attribute indicates whether the specified window is
resizable *by the user*. This is controlled by the [window hint](@ref resizable *by the user*. This is controlled by the
window_hints) with the same name. [window hint](@ref window_hints) with the same name.
The `GLFW_DECORATED` attribute indicates whether the specified window has The `GLFW_DECORATED` attribute indicates whether the specified window has
decorations such as a border, a close widget, etc. This is controlled by the decorations such as a border, a close widget, etc. This is controlled by the