~ubuntu-branches/debian/sid/stellarium/sid

« back to all changes in this revision

Viewing changes to src/core/StelTexture.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2012-05-22 10:14:07 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20120522101407-038f2hr2jj6ra59c
Tags: 0.11.3-1
ImportedĀ UpstreamĀ versionĀ 0.11.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * along with this program; if not, write to the Free Software
17
17
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
18
18
 */
19
 
 
20
19
#include <cstdlib>
21
20
#include "StelTextureMgr.hpp"
22
21
#include "StelTexture.hpp"
98
97
        emit finished(image);
99
98
}
100
99
 
101
 
 
102
100
StelTexture::StelTexture() : loader(NULL), downloaded(false), isLoadingImage(false),
103
101
                                   errorOccured(false), id(0), avgLuminance(-1.f)
104
102
{
 
103
        #if QT_VERSION>=0x040800
 
104
        initializeGLFunctions();
 
105
        #endif
105
106
        width = -1;
106
107
        height = -1;
107
108
}
144
145
/*************************************************************************
145
146
 Bind the texture so that it can be used for openGL drawing (calls glBindTexture)
146
147
 *************************************************************************/
 
148
 
147
149
bool StelTexture::bind()
148
150
{
149
151
        // qDebug() << "TEST bind" << fullPath;
153
155
#ifdef USE_OPENGL_ES2
154
156
                glActiveTexture(GL_TEXTURE0);
155
157
#endif
 
158
 
156
159
                glBindTexture(GL_TEXTURE_2D, id);
157
160
                return true;
158
161
        }
186
189
{
187
190
        if (width<0 || height<0)
188
191
        {
 
192
 
189
193
                if (!qImage.isNull())
190
194
                {
191
195
                        width = qImage.width();
203
207
                        width = size.width();
204
208
                        height = size.height();
205
209
                }
 
210
 
206
211
        }
207
212
        awidth = width;
208
213
        aheight = height;