| @@ -0,0 +1,77 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either context 2 | ||
| of the License, or (at your option) any later context. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_CONTEXT_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_CONTEXT_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/backend/current_fwd.hpp> | ||
| #include <sge/opengl/backend/fun_ptr.hpp> | ||
| #include <sge/opengl/info/context_fwd.hpp> | ||
| #include <sge/opengl/info/extension_set.hpp> | ||
| #include <sge/opengl/info/version.hpp> | ||
| #include <fcppt/noncopyable.hpp> | ||
| #include <fcppt/config/external_begin.hpp> | ||
| #include <string> | ||
| #include <fcppt/config/external_end.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| class context | ||
| { | ||
| FCPPT_NONCOPYABLE( | ||
| context | ||
| ); | ||
| public: | ||
| explicit | ||
| context( | ||
| sge::opengl::backend::current const & | ||
| ); | ||
|
|
||
| ~context(); | ||
|
|
||
| sge::opengl::info::version | ||
| version() const; | ||
|
|
||
| sge::opengl::info::extension_set const & | ||
| extensions() const; | ||
|
|
||
| sge::opengl::backend::fun_ptr | ||
| load_function( | ||
| std::string const & | ||
| ) const; | ||
| private: | ||
| sge::opengl::backend::current const ¤t_; | ||
|
|
||
| sge::opengl::info::version const version_; | ||
|
|
||
| sge::opengl::info::extension_set const extensions_; | ||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either extension_set 2 | ||
| of the License, or (at your option) any later extension_set. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_EXTENSION_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_EXTENSION_HPP_INCLUDED | ||
|
|
||
| #include <fcppt/strong_typedef.hpp> | ||
| #include <fcppt/config/external_begin.hpp> | ||
| #include <string> | ||
| #include <fcppt/config/external_end.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| FCPPT_MAKE_STRONG_TYPEDEF( | ||
| std::string, | ||
| extension | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either extension_set 2 | ||
| of the License, or (at your option) any later extension_set. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_EXTENSION_SET_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_EXTENSION_SET_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/extension_set.hpp> | ||
| #include <sge/opengl/info/extension.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| typedef | ||
| sge::opengl::extension_set< | ||
| sge::opengl::info::extension | ||
| > | ||
| extension_set; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either extension_supported 2 | ||
| of the License, or (at your option) any later extension_supported. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_EXTENSION_SUPPORTED_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_EXTENSION_SUPPORTED_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/info/extension.hpp> | ||
| #include <sge/opengl/info/extension_set.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| bool | ||
| extension_supported( | ||
| sge::opengl::info::extension_set const &, | ||
| sge::opengl::info::extension const & | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either context 2 | ||
| of the License, or (at your option) any later context. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_GET_EXTENSIONS_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_GET_EXTENSIONS_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/backend/current_fwd.hpp> | ||
| #include <sge/opengl/info/extension_set.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| sge::opengl::info::extension_set | ||
| get_extensions( | ||
| sge::opengl::backend::current const & | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either context 2 | ||
| of the License, or (at your option) any later context. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_GET_VERSION_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_GET_VERSION_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/backend/current_fwd.hpp> | ||
| #include <sge/opengl/info/version.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| sge::opengl::info::version | ||
| get_version( | ||
| sge::opengl::backend::current const & | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_VERSION_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_VERSION_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/info/major_version.hpp> | ||
| #include <sge/opengl/info/minor_version.hpp> | ||
| #include <sge/opengl/info/version_fwd.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| class version | ||
| { | ||
| public: | ||
| version( | ||
| sge::opengl::info::major_version, | ||
| sge::opengl::info::minor_version | ||
| ); | ||
|
|
||
| sge::opengl::info::major_version | ||
| major() const; | ||
|
|
||
| sge::opengl::info::minor_version | ||
| minor() const; | ||
| private: | ||
| sge::opengl::info::major_version major_; | ||
|
|
||
| sge::opengl::info::minor_version minor_; | ||
| }; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_VERSION_AT_LEAST_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_VERSION_AT_LEAST_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/info/major_version.hpp> | ||
| #include <sge/opengl/info/minor_version.hpp> | ||
| #include <sge/opengl/info/version_fwd.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| bool | ||
| version_at_least( | ||
| sge::opengl::info::version, | ||
| sge::opengl::info::major_version, | ||
| sge::opengl::info::minor_version | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_INFO_VERSION_TYPE_HPP_INCLUDED | ||
| #define SGE_OPENGL_INFO_VERSION_TYPE_HPP_INCLUDED | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
| namespace info | ||
| { | ||
|
|
||
| typedef | ||
| unsigned | ||
| version_type; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -0,0 +1,89 @@ | ||
| /* | ||
| spacegameengine is a portable easy to use game engine written in C++. | ||
| Copyright (C) 2006-2015 Carl Philipp Reh (carlphilippreh <at> gmail.com) | ||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public License | ||
| as published by the Free Software Foundation; either extension_set 2 | ||
| of the License, or (at your option) any later extension_set. | ||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Lesser General Public License for more details. | ||
| You should have received a copy of the GNU Lesser General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef SGE_OPENGL_PARSE_EXTENSIONS_HPP_INCLUDED | ||
| #define SGE_OPENGL_PARSE_EXTENSIONS_HPP_INCLUDED | ||
|
|
||
| #include <sge/opengl/extension_set.hpp> | ||
| #include <fcppt/algorithm/map.hpp> | ||
| #include <fcppt/config/external_begin.hpp> | ||
| #include <boost/range/iterator_range_core.hpp> | ||
| #include <iterator> | ||
| #include <sstream> | ||
| #include <string> | ||
| #include <utility> | ||
| #include <fcppt/config/external_end.hpp> | ||
|
|
||
|
|
||
| namespace sge | ||
| { | ||
| namespace opengl | ||
| { | ||
|
|
||
| template< | ||
| typename Type | ||
| > | ||
| sge::opengl::extension_set< | ||
| Type | ||
| > | ||
| parse_extensions( | ||
| std::string const &_extensions | ||
| ) | ||
| { | ||
| std::istringstream stream( | ||
| _extensions | ||
| ); | ||
|
|
||
| typedef | ||
| std::istream_iterator< | ||
| std::string | ||
| > | ||
| iterator; | ||
|
|
||
| return | ||
| fcppt::algorithm::map< | ||
| sge::opengl::extension_set< | ||
| Type | ||
| > | ||
| >( | ||
| boost::make_iterator_range( | ||
| iterator( | ||
| stream | ||
| ), | ||
| iterator() | ||
| ), | ||
| []( | ||
| std::string const &_element | ||
| ) | ||
| { | ||
| return | ||
| Type( | ||
| std::move( | ||
| _element | ||
| ) | ||
| ); | ||
| } | ||
| ); | ||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
| #endif |
| @@ -56,8 +56,7 @@ sge::opengl::texture::basic_box< | ||
| this | ||
| ]{ | ||
| sge::opengl::texture::scoped_work_binding const binding( | ||
| _basic_parameters.context(), | ||
| this->type(), | ||
| this->id() | ||
| ); | ||