Browse Source

doc: updated also Getting Started image to the new color.

pull/87/head
Vladimír Vondruš 11 years ago
parent
commit
7ebec50d2b
  1. 9
      doc/generated/CMakeLists.txt
  2. 21
      doc/generated/README.md
  3. 54
      doc/generated/hello.cpp
  4. BIN
      doc/getting-started-blue.png
  5. 4
      doc/getting-started.dox
  6. BIN
      doc/getting-started.png

9
doc/generated/CMakeLists.txt

@ -31,7 +31,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../modules/")
find_package(Magnum REQUIRED
MeshTools
Primitives
Shaders)
Shaders
Sdl2Application)
if(CORRADE_TARGET_APPLE)
find_package(Magnum REQUIRED WindowlessCglApplication)
@ -49,8 +50,14 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}")
include_directories(${MAGNUM_INCLUDE_DIRS}
${MAGNUM_APPLICATION_INCLUDE_DIRS}
${MAGNUM_WINDOWLESSAPPLICATION_INCLUDE_DIRS})
add_executable(hello hello.cpp)
target_link_libraries(hello
${MAGNUM_LIBRARIES}
${MAGNUM_APPLICATION_LIBRARIES})
add_executable(shaders shaders.cpp)
target_link_libraries(shaders
${MAGNUM_LIBRARIES}

21
doc/generated/README.md

@ -1,9 +1,9 @@
Source files for images in Magnum documentation
-----------------------------------------------
Compile and install Magnum with windowless application for your platform and
`magnum-distancefieldconverter` utility and any `PngImporter` and
`PngImageConverter` plugins from Magnum Plugins.
Compile and install Magnum with `Sdl2Application`, windowless application for
your platform and `magnum-distancefieldconverter` utility and any `PngImporter`
and `PngImageConverter` plugins from Magnum Plugins.
Create build dir, point CMake to this directory and compile the executables:
@ -12,6 +12,21 @@ Create build dir, point CMake to this directory and compile the executables:
cmake ../doc/generated
cmake --build .
### "Getting started" image
Displayed by the `hello` executable. Run the app and take screenshot using
KSnapshot (including decorations, 880x707). Similarly for the gray version. The
resulting files should be resized to half the size and without alpha channel
using imagemagick:
```bash
mogrify -flatten -background '#ffffff' -resize 440 getting-started.png
mogrify -flatten -background '#ffffff' -resize 440 getting-started-blue.png
```
The output printed by the application can be used to update the example output
in `doc/getting-started.dox`.
### Shader images
Generated by the `shaders` executable. Must be run in this directory, the

54
doc/generated/hello.cpp

@ -0,0 +1,54 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <Magnum/Color.h>
#include <Magnum/DefaultFramebuffer.h>
#include <Magnum/Context.h>
#include <Magnum/Renderer.h>
#include <Magnum/Version.h>
#include <Magnum/Platform/Sdl2Application.h>
using namespace Magnum;
class Hello: public Platform::Application {
public:
explicit Hello(const Arguments& arguments);
private:
void drawEvent() override;
};
Hello::Hello(const Arguments& arguments): Platform::Application(arguments) {
Renderer::setClearColor(Color3::fromHSV(216.0_degf, 0.85f, 1.0f));
Debug() << "Hello! This application is running on" << Context::current()->version()
<< "using" << Context::current()->rendererString();
}
void Hello::drawEvent() {
defaultFramebuffer.clear(FramebufferClear::Color);
swapBuffers();
}
MAGNUM_APPLICATION_MAIN(Hello)

BIN
doc/getting-started-blue.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

4
doc/getting-started.dox

@ -196,7 +196,7 @@ First include the needed headers:
And in the constructor (which is currently empty) change the clear color and
print something to debug output:
@code
Renderer::setClearColor({0.07f, 0.44f, 0.73f});
Renderer::setClearColor(Color3::fromHSV(216.0_degf, 0.85f, 1.0f));
Debug() << "Hello! This application is running on" << Context::current()->version()
<< "using" << Context::current()->rendererString();
@ -205,7 +205,7 @@ Debug() << "Hello! This application is running on" << Context::current()->versio
After rebuilding and starting the application, the clear color changes to
blueish one and something like this would be printed to the console:
> Hello! This application is running on OpenGL 3.3 using Geforce GT 330M
> Hello! This application is running on OpenGL 4.5 using GeForce GT 740M
@image html getting-started-blue.png
@image latex getting-started-blue.png

BIN
doc/getting-started.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Loading…
Cancel
Save