MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / rend_FillRect

Function rend_FillRect

renderer/HardwareOpenGL.cpp:1771–1792  ·  view source on GitHub ↗

Fills a rectangle on the display

Source from the content-addressed store, hash-verified

1769
1770// Fills a rectangle on the display
1771void rend_FillRect(ddgr_color color, int x1, int y1, int x2, int y2) {
1772 int r = GR_COLOR_RED(color);
1773 int g = GR_COLOR_GREEN(color);
1774 int b = GR_COLOR_BLUE(color);
1775
1776 int width = x2 - x1;
1777 int height = y2 - y1;
1778
1779 x1 += gpu_state.clip_x1;
1780 y1 += gpu_state.clip_y1;
1781
1782 dglEnable(GL_SCISSOR_TEST);
1783 dglScissor(x1, gpu_state.screen_height - (height + y1), width, height);
1784 dglClearColor((float)r / 255.0, (float)g / 255.0, (float)b / 255.0, 0);
1785 dglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1786
1787 width = gpu_state.clip_x2 - gpu_state.clip_x1;
1788 height = gpu_state.clip_y2 - gpu_state.clip_y1;
1789
1790 dglScissor(gpu_state.clip_x1, gpu_state.screen_height - (gpu_state.clip_y1 + height), width, height);
1791 dglDisable(GL_SCISSOR_TEST);
1792}
1793
1794// Sets a pixel on the display
1795void rend_SetPixel(ddgr_color color, int x, int y) {

Callers 6

fillMethod · 0.50
RenderTerrainFunction · 0.50
RenderBackgroundFunction · 0.50
fillrectMethod · 0.50
clearMethod · 0.50
lock_clearMethod · 0.50

Calls 3

GR_COLOR_REDFunction · 0.85
GR_COLOR_GREENFunction · 0.85
GR_COLOR_BLUEFunction · 0.85

Tested by

no test coverage detected