- 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:
Alexander Bock
2017-03-01 21:02:33 -05:00
parent 4e52f27f9e
commit fbea8389c8
25 changed files with 135 additions and 108 deletions

View File

@@ -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__

View File

@@ -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;
};