Browse Source

doc: updated Getting Started guide.

pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
8be2293977
  1. BIN
      doc/getting-started-blue.png
  2. 20
      doc/getting-started.dox
  3. BIN
      doc/getting-started.png

BIN
doc/getting-started-blue.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

20
doc/getting-started.dox

@ -94,8 +94,7 @@ class MyApplication: public Platform::Application {
public: public:
explicit MyApplication(const Arguments& arguments); explicit MyApplication(const Arguments& arguments);
protected: private:
void viewportEvent(const Vector2i& size) override;
void drawEvent() override; void drawEvent() override;
}; };
@ -103,10 +102,6 @@ MyApplication::MyApplication(const Arguments& arguments): Platform::Application(
// TODO: Add your initialization code here // TODO: Add your initialization code here
} }
void MyApplication::viewportEvent(const Vector2i& size) {
defaultFramebuffer.setViewport({{}, size});
}
void MyApplication::drawEvent() { void MyApplication::drawEvent() {
defaultFramebuffer.clear(FramebufferClear::Color); defaultFramebuffer.clear(FramebufferClear::Color);
@ -118,10 +113,10 @@ void MyApplication::drawEvent() {
MAGNUM_APPLICATION_MAIN(MyApplication) MAGNUM_APPLICATION_MAIN(MyApplication)
@endcode @endcode
The application essentially does nothing, just clears properly sized screen The application essentially does nothing, just clears screen framebuffer to
framebuffer to default (black) color and then does buffer swap to actually default (dark gray) color and then does buffer swap to actually display it on
display it on the screen. `CMakeLists.txt` finds %Magnum, sets up compiler the screen. `CMakeLists.txt` finds %Magnum, sets up compiler flags, creates the
flags, creates the executable and links it to all needed libraries: executable and links it to all needed libraries:
@code @code
find_package(Magnum REQUIRED GlutApplication) find_package(Magnum REQUIRED GlutApplication)
@ -181,9 +176,8 @@ Debug() << "Hello! This application is running on" << Context::current()->versio
After rebuilding and starting the application, the clear color changes to After rebuilding and starting the application, the clear color changes to
blueish one and something like this would be printed to the console: blueish one and something like this would be printed to the console:
@code
Hello! This application is running on OpenGL 3.3 using Geforce GT 330M > Hello! This application is running on OpenGL 3.3 using Geforce GT 330M
@endcode
@image html getting-started-blue.png @image html getting-started-blue.png
@image latex getting-started-blue.png @image latex getting-started-blue.png

BIN
doc/getting-started.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Loading…
Cancel
Save