mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
- Add check in style guide that prevents ‘using namespace’ in header files
- Remove using namespace ghoul::opengl from Globebrowsing and adjust
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__
|
||||
#define __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__
|
||||
#ifndef __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__
|
||||
#define __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__
|
||||
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
|
||||
@@ -36,4 +36,4 @@ LuaLibrary openglSystemCapabilities();
|
||||
} // namespace scripting
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___SYSTEMCAPABLITIESBINDING___H__
|
||||
#endif // __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
|
||||
namespace openspace {
|
||||
|
||||
using namespace ghoul::opengl;
|
||||
|
||||
|
||||
/**
|
||||
* Very simple class maintaining a uniform location.
|
||||
*/
|
||||
@@ -47,7 +44,7 @@ public:
|
||||
* Updates the uniform location of the uniform variable named <name>
|
||||
* in the provided shader program.
|
||||
*/
|
||||
void bind(ProgramObject* program, const std::string& name);
|
||||
void bind(ghoul::opengl::ProgramObject* program, const std::string& name);
|
||||
|
||||
protected:
|
||||
GLint _uniformLocation = -1;
|
||||
@@ -67,7 +64,7 @@ public:
|
||||
* Sets the value of T to its corresponding GPU value.
|
||||
* OBS! Users must ensure bind has been called before using this method
|
||||
*/
|
||||
void setValue(ProgramObject* program, T val){
|
||||
void setValue(ghoul::opengl::ProgramObject* program, T val){
|
||||
program->setUniform(_uniformLocation, val);
|
||||
}
|
||||
|
||||
@@ -86,8 +83,8 @@ public:
|
||||
* program.
|
||||
* OBS! Users must ensure bind has been called before using this method.
|
||||
*/
|
||||
void setValue(ProgramObject* program, std::shared_ptr<Texture> texture){
|
||||
_texUnit = std::make_unique<TextureUnit>();
|
||||
void setValue(ghoul::opengl::ProgramObject* program, std::shared_ptr<ghoul::opengl::Texture> texture){
|
||||
_texUnit = std::make_unique<ghoul::opengl::TextureUnit>();
|
||||
_texUnit->activate();
|
||||
texture->bind();
|
||||
program->setUniform(_uniformLocation, *_texUnit);
|
||||
@@ -99,7 +96,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
std::unique_ptr<TextureUnit> _texUnit;
|
||||
std::unique_ptr<ghoul::opengl::TextureUnit> _texUnit;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user