Beatmup
rendering_context.cpp
Go to the documentation of this file.
1 /*
2  Beatmup image and signal processing library
3  Copyright (C) 2019, lnstadrum
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "rendering_context.h"
20 
21 using namespace Beatmup;
22 
23 RenderingContext::RenderingContext(GraphicPipeline& gpu, EventListener* eventListener, const ImageResolution& outputResolution, const float outputWidth, const bool renderingOnScreen) :
24  eventListener(eventListener), outputResolution(outputResolution), outputWidth(outputWidth), renderingOnScreen(renderingOnScreen), gpu(gpu)
25 {
27 }
28 
29 
32 }
33 
34 
36  unlock(bitmap);
37 }
38 
39 
42 }
43 
44 
47 }
48 
49 
52 }
53 
54 
57 }
A very basic class for any image.
void unlock(AbstractBitmap *bitmap)
Drops a lock to the bitmap.
void readLock(GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
Locks content of a bitmap for reading using a specific processing target device.
Regular OpenGL program.
Definition: program.h:229
void enableProgram(GraphicPipeline *gpu, Operation program)
Select and enable a common program.
Operation
Standard rendering operations.
void blend(bool onScreen)
Performs the blending operation.
void bindMask(GraphicPipeline *gpu, AbstractBitmap &mask)
Binds a mask to a masked rendering program.
Internal low-level GPU control API.
Definition: pipeline.h:33
GL::RenderingPrograms & getRenderingPrograms()
Definition: pipeline.h:125
Represents image size in pixels.
void blend()
Initiates the rendering operation.
void bindMask(AbstractBitmap &mask)
void unlockBitmap(AbstractBitmap *bitmap)
RenderingContext(GraphicPipeline &gpu, EventListener *eventListener, const ImageResolution &outputResolution, const float refWidth, const bool renderingOnScreen)
void enableProgram(GL::RenderingPrograms::Operation operation)
void lockBitmap(AbstractBitmap *bitmap)
Beatmup::InternalBitmap * bitmap