This C++ example stub showcases the simple Launcher01.hpp mainloop framework integration.
This C++ example stub showcases the simple Launcher01.hpp mainloop framework integration. It creates a window, provides keyboard interaction and uses RedSquareES2 gamp::wt::RenderListener for rendering.
#include <cstdio>
#include <cmath>
#include <memory>
#include "../demos/RedSquareES2.hpp"
#include "../demos/GLLauncher01.hpp"
private:
private:
public:
if( win ) {
}
}
}
}
};
public:
m_kl(std::make_shared<MyKeyListener>(*this)) { }
return false;
}
win->addKeyListener(m_kl);
return true;
}
win->removeKeyListener(m_kl);
}
};
int main(
int argc,
char *argv[])
{
return launch(
"RedSquareES2.hpp",
std::make_shared<Example>(), argc, argv);
}
int launch(std::string_view sfile, const GLLaunchProps &props, const RenderListenerRef &demo, int argc, char *argv[])
int main(int argc, char *argv[])
std::shared_ptr< MyKeyListener > MyKeyListenerRef
void dispose(const WindowRef &win, const jau::fraction_timespec &when) override
Notifies the listener to perform the release of all renderer resources per context,...
bool init(const WindowRef &, const jau::fraction_timespec &when) override
Called by the drawable immediately after the render context is initialized.
void dispose(const WindowRef &, const jau::fraction_timespec &) override
Notifies the listener to perform the release of all renderer resources per context,...
bool animating() const noexcept
std::string toString() const noexcept
constexpr VKeyCode keySym() const noexcept
Returns the virtual key symbol reflecting the current keyboard layout.
Listener for multiple KeyEvent.
virtual const PressedKeyCodes & pressedKeyCodes() const noexcept=0
constexpr const WindowWeakPtr & source() const noexcept
constexpr const jau::fraction_timespec & when() const noexcept
size_t bitCount() const noexcept
@ verbose
Verbose operations (debugging).
std::shared_ptr< Window > WindowRef
@ VK_ESCAPE
Constant for the ESCAPE function key.
@ VK_PAUSE
Constant for the PAUSE function key.
int fprintf_td(const uint64_t elapsed_ms, FILE *stream, const char *format,...) noexcept
Convenient fprintf() invocation, prepending the given elapsed_ms timestamp.
Timespec structure using int64_t for its components in analogy to struct timespec_t on 64-bit platfor...
constexpr uint64_t to_ms() const noexcept
Returns time in milliseconds.