Rename DisplayExample to WindowExample
This commit is contained in:
parent
24da7f45e0
commit
8901257bb6
6 changed files with 25 additions and 19 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
include("Macros")
|
include("Macros")
|
||||||
|
|
||||||
add_subdirectory(display)
|
add_subdirectory(window)
|
||||||
add_subdirectory(events)
|
add_subdirectory(events)
|
||||||
add_subdirectory(input)
|
add_subdirectory(input)
|
||||||
add_subdirectory(text)
|
add_subdirectory(text)
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
|
|
||||||
#find_package(Spectre REQUIRED)
|
|
||||||
|
|
||||||
set (SOURCE
|
|
||||||
DisplayExample.cpp
|
|
||||||
main.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
spectre_example(display
|
|
||||||
main.cpp
|
|
||||||
DisplayExample.cpp
|
|
||||||
)
|
|
||||||
7
examples/window/CMakeLists.txt
Normal file
7
examples/window/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
#find_package(Spectre REQUIRED)
|
||||||
|
|
||||||
|
spectre_example(window
|
||||||
|
main.cpp
|
||||||
|
WindowExample.cpp
|
||||||
|
)
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
#include <Spectre/Graphics/BatchRenderer2D.h>
|
#include <Spectre/Graphics/BatchRenderer2D.h>
|
||||||
#include <Spectre/System/MessageHandler.h>
|
#include <Spectre/System/MessageHandler.h>
|
||||||
#include <Spectre/System/Log.h>
|
#include <Spectre/System/Log.h>
|
||||||
#include "DisplayExample.h"
|
#include "WindowExample.h"
|
||||||
|
|
||||||
void DisplayExample::init()
|
void WindowExample::init()
|
||||||
{
|
{
|
||||||
m_renderer = new sp::BatchRenderer2D();
|
m_renderer = new sp::BatchRenderer2D();
|
||||||
m_mode = sp::Window::WINDOWED;
|
m_mode = sp::Window::WINDOWED;
|
||||||
|
|
@ -20,7 +20,7 @@ void DisplayExample::init()
|
||||||
m_renderer->setCamera(m_camera);
|
m_renderer->setCamera(m_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayExample::onEvent(const sp::Event& event)
|
void WindowExample::onEvent(const sp::Event& event)
|
||||||
{
|
{
|
||||||
if (event.type == sp::Event::Key && event.key.pressed == false) {
|
if (event.type == sp::Event::Key && event.key.pressed == false) {
|
||||||
|
|
||||||
|
|
@ -51,12 +51,12 @@ void DisplayExample::onEvent(const sp::Event& event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayExample::update(double dt)
|
void WindowExample::update(double dt)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayExample::render()
|
void WindowExample::render()
|
||||||
{
|
{
|
||||||
sp::Graphics* g = getGraphics();
|
sp::Graphics* g = getGraphics();
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
#include <Spectre/System/EventListener.h>
|
#include <Spectre/System/EventListener.h>
|
||||||
#include <Spectre/Game.h>
|
#include <Spectre/Game.h>
|
||||||
|
|
||||||
class DisplayExample : public sp::Game, sp::EventListener
|
class WindowExample : public sp::Game, sp::EventListener
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
void onEvent(const sp::Event& event);
|
void onEvent(const sp::Event& event);
|
||||||
11
examples/window/main.cpp
Normal file
11
examples/window/main.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
#include "WindowExample.h"
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
WindowExample game;
|
||||||
|
|
||||||
|
game.run();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue