#include <iostream>
#include <SDL_image.h>
#include <GL/gl.h>
-#include <GL/glu.h>
#include "drawing_context.hpp"
#include "surface.hpp"
}
void
+DrawingContext::draw_filled_rect(const Rect& rect, const Color& color,
+ int layer)
+{
+ DrawingRequest request;
+
+ request.type = FILLRECT;
+ request.pos = transform.apply(rect.p1);
+ request.layer = layer;
+
+ request.drawing_effect = transform.drawing_effect;
+ request.alpha = transform.alpha;
+
+ FillRectRequest* fillrectrequest = new FillRectRequest;
+ fillrectrequest->size = Vector(rect.get_width(), rect.get_height());
+ fillrectrequest->color = color;
+ fillrectrequest->color.alpha = color.alpha * transform.alpha;
+ request.request_data = fillrectrequest;
+
+ requests->push_back(request);
+}
+
+void
DrawingContext::draw_surface_part(DrawingRequest& request)
{
SurfacePartRequest* surfacepartrequest
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ //glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
handle_drawing_requests(lightmap_requests);
lightmap_requests.clear();
drawing_requests.clear();
if(use_lightmap) {
- glBlendFunc(GL_DST_COLOR, GL_ZERO);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBindTexture(GL_TEXTURE_2D, lightmap->get_handle());
glBegin(GL_QUADS);