Fills a rectangle on the display
| 1769 | |
| 1770 | // Fills a rectangle on the display |
| 1771 | void 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 |
| 1795 | void rend_SetPixel(ddgr_color color, int x, int y) { |
no test coverage detected