mirror of
https://github.com/lubosz/overte.git
synced 2025-04-27 21:35:29 +02:00
fix missing link to starfield implementation files
This commit is contained in:
parent
53ffff2718
commit
1ddc52252a
5 changed files with 34 additions and 72 deletions
interface
|
@ -38,14 +38,11 @@ configure_file(InterfaceConfig.h.in ${PROJECT_BINARY_DIR}/includes/InterfaceConf
|
|||
|
||||
# grab the implementation and header files from src dirs
|
||||
file(GLOB INTERFACE_SRCS src/*.cpp src/*.h)
|
||||
foreach(SUBDIR avatar devices renderer ui)
|
||||
file(GLOB SUBDIR_SRCS src/${SUBDIR}/*.cpp src/${SUBDIR}/*.h)
|
||||
foreach(SUBDIR avatar devices renderer ui starfield)
|
||||
file(GLOB_RECURSE SUBDIR_SRCS src/${SUBDIR}/*.cpp src/${SUBDIR}/*.h)
|
||||
set(INTERFACE_SRCS ${INTERFACE_SRCS} ${SUBDIR_SRCS})
|
||||
endforeach(SUBDIR)
|
||||
|
||||
# project subdirectories
|
||||
add_subdirectory(src/starfield)
|
||||
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Multimedia REQUIRED)
|
||||
|
|
|
@ -7,11 +7,9 @@
|
|||
//
|
||||
|
||||
#include "InterfaceConfig.h"
|
||||
#include "Stars.h"
|
||||
#include "Stars.h"
|
||||
|
||||
#define __interface__Starfield_impl__
|
||||
#include "starfield/Controller.h"
|
||||
#undef __interface__Starfield_impl__
|
||||
|
||||
Stars::Stars() :
|
||||
_controller(0l), _starsLoaded(false) {
|
||||
|
@ -43,7 +41,7 @@ void Stars::render(float fovY, float aspect, float nearZ, float alpha) {
|
|||
// pull the modelview matrix off the GL stack
|
||||
glm::mat4 view; glGetFloatv(GL_MODELVIEW_MATRIX, glm::value_ptr(view));
|
||||
|
||||
_controller->render(fovDiagonal, aspect, glm::affineInverse(view), alpha);
|
||||
_controller->render(fovDiagonal, aspect, glm::affineInverse(view), alpha);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,53 +13,39 @@
|
|||
|
||||
namespace starfield { class Controller; }
|
||||
|
||||
//
|
||||
// Starfield rendering component.
|
||||
//
|
||||
// Starfield rendering component.
|
||||
class Stars {
|
||||
public:
|
||||
Stars();
|
||||
~Stars();
|
||||
public:
|
||||
Stars();
|
||||
~Stars();
|
||||
|
||||
//
|
||||
// Generate stars from random number seed
|
||||
//
|
||||
// The numStars parameter sets the number of stars to generate.
|
||||
//
|
||||
bool generate(unsigned numStars, unsigned seed);
|
||||
// Generate stars from random number
|
||||
// The numStars parameter sets the number of stars to generate.
|
||||
bool generate(unsigned numStars, unsigned seed);
|
||||
|
||||
//
|
||||
// Renders the starfield from a local viewer's perspective.
|
||||
// The parameters specifiy the field of view.
|
||||
//
|
||||
void render(float fovY, float aspect, float nearZ, float alpha);
|
||||
// Renders the starfield from a local viewer's perspective.
|
||||
// The parameters specifiy the field of view.
|
||||
void render(float fovY, float aspect, float nearZ, float alpha);
|
||||
|
||||
//
|
||||
// Sets the resolution for FOV culling.
|
||||
//
|
||||
// The parameter determines the number of tiles in azimuthal
|
||||
// and altitudinal directions.
|
||||
//
|
||||
// GPU resources are updated upon change in which case 'true'
|
||||
// is returned.
|
||||
//
|
||||
bool setResolution(unsigned k);
|
||||
// Sets the resolution for FOV culling.
|
||||
//
|
||||
// The parameter determines the number of tiles in azimuthal
|
||||
// and altitudinal directions.
|
||||
//
|
||||
// GPU resources are updated upon change in which case 'true'
|
||||
// is returned.
|
||||
bool setResolution(unsigned k);
|
||||
|
||||
// Returns true when stars have been loaded
|
||||
bool isStarsLoaded() const { return _starsLoaded; };
|
||||
private:
|
||||
// don't copy/assign
|
||||
Stars(Stars const&); // = delete;
|
||||
Stars& operator=(Stars const&); // delete;
|
||||
|
||||
starfield::Controller* _controller;
|
||||
|
||||
|
||||
//
|
||||
// Returns true when stars have been loaded
|
||||
//
|
||||
bool isStarsLoaded() const { return _starsLoaded; };
|
||||
private:
|
||||
// don't copy/assign
|
||||
Stars(Stars const&); // = delete;
|
||||
Stars& operator=(Stars const&); // delete;
|
||||
|
||||
// variables
|
||||
|
||||
starfield::Controller* _controller;
|
||||
|
||||
bool _starsLoaded;
|
||||
bool _starsLoaded;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
project(starfield)
|
||||
|
||||
# Only headers (that are facaded by the Stars.cpp file) here -
|
||||
# hence declared as custom target.
|
||||
|
||||
file(GLOB_RECURSE STARFIELD_SRCS *.cpp *.h)
|
||||
add_custom_target("starfield" SOURCES ${STARFIELD_SRCS})
|
||||
|
|
@ -18,25 +18,16 @@
|
|||
#include "starfield/renderer/VertexOrder.h"
|
||||
|
||||
namespace starfield {
|
||||
|
||||
class Controller {
|
||||
public:
|
||||
|
||||
Controller() : _tileResolution(20), _renderer(0l) { }
|
||||
|
||||
~Controller() {
|
||||
delete _renderer;
|
||||
}
|
||||
|
||||
~Controller() { delete _renderer; }
|
||||
|
||||
bool computeStars(unsigned numStars, unsigned seed);
|
||||
|
||||
bool setResolution(unsigned tileResolution);
|
||||
|
||||
|
||||
void render(float perspective, float angle, mat4 const& orientation, float alpha);
|
||||
|
||||
private:
|
||||
|
||||
void retile(unsigned numStars, unsigned tileResolution);
|
||||
|
||||
void recreateRenderer(unsigned numStars, unsigned tileResolution);
|
||||
|
@ -45,7 +36,6 @@ namespace starfield {
|
|||
unsigned _tileResolution;
|
||||
unsigned _numStars;
|
||||
Renderer* _renderer;
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue