comparison engine/core/video/opengl/glimage.cpp @ 661:e3140f01749d

* Merged the light branch back into trunk. * Modified the demos so they work with the new loaders and setting.
author helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 05 Nov 2010 15:21:10 +0000
parents 5d6b1820b953
children
comparison
equal deleted inserted replaced
660:b0733d998d0f 661:e3140f01749d
108 108
109 // apply the scale to the width and height of the image 109 // apply the scale to the width and height of the image
110 uint16_t w = static_cast<int>(round(scale_x*m_surface->w)); 110 uint16_t w = static_cast<int>(round(scale_x*m_surface->w));
111 uint16_t h = static_cast<int>(round(scale_y*m_surface->h)); 111 uint16_t h = static_cast<int>(round(scale_y*m_surface->h));
112 112
113 /// setting transparency for the whole primitive: 113 // setting transparency for the whole primitive:
114 glColor4ub( 255, 255, 255, alpha ); 114 glColor4ub( 255, 255, 255, alpha );
115 115
116 glEnable(GL_TEXTURE_2D); 116 glEnable(GL_TEXTURE_2D);
117 glBindTexture(GL_TEXTURE_2D, m_textureids[0]); 117 glBindTexture(GL_TEXTURE_2D, m_textureids[0]);
118 118
237 237
238 void GLImage::setClipArea(const Rect& cliparea, bool clear) { 238 void GLImage::setClipArea(const Rect& cliparea, bool clear) {
239 glScissor(cliparea.x, getHeight() - cliparea.y - cliparea.h, cliparea.w, cliparea.h); 239 glScissor(cliparea.x, getHeight() - cliparea.y - cliparea.h, cliparea.w, cliparea.h);
240 240
241 if (clear) { 241 if (clear) {
242 glClear(GL_COLOR_BUFFER_BIT); 242 glClear(GL_COLOR_BUFFER_BIT);
243 } 243 }
244 } 244 }
245 245
246 bool GLImage::putPixel(int x, int y, int r, int g, int b, int a) { 246 bool GLImage::putPixel(int x, int y, int r, int g, int b, int a) {
247 cleanup(); 247 cleanup();
275 275
276 void GLImage::drawVertex(const Point& p, const uint8_t size, int r, int g, int b, int a) { 276 void GLImage::drawVertex(const Point& p, const uint8_t size, int r, int g, int b, int a) {
277 cleanup(); 277 cleanup();
278 m_sdlimage->drawVertex(p, size, r, g, b, a); 278 m_sdlimage->drawVertex(p, size, r, g, b, a);
279 } 279 }
280
281 void GLImage::drawLightPrimitive(const Point& p, uint8_t intensity, float radius, int subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue) {
282 cleanup();
283 m_sdlimage->drawLightPrimitive(p, intensity, radius, subdivisions, xstretch, ystretch, red, green, blue);
284 }
280 } 285 }