-static void
-hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
- GLsizei width, GLsizei height)
-{
- TRACE("%s(glContext: %p, x: %d, y: %d, w: %d, h: %d\n", __func__,
- glContext, x, y, width, height);
-
- struct gl_framebuffer *draw = glContext->WinSysDrawBuffer;
- struct gl_framebuffer *read = glContext->WinSysReadBuffer;
-
- // TODO: SLOW! We need to check for changes in bitmap vs gl_framebuffer
- // size before doing a _mesa_resize_framebuffer.
- if (draw)
- _mesa_resize_framebuffer(glContext, draw, width, height);
- if (read)
- _mesa_resize_framebuffer(glContext, read, width, height);
-}
-
-
-static st_visual*
-hgl_fill_st_visual(gl_config* glVisual)
-{
- struct st_visual* stVisual = CALLOC_STRUCT(st_visual);
- if (!stVisual) {
- ERROR("%s: Couldn't allocate st_visual\n", __func__);
- return NULL;
- }
-
- // Determine color format
- if (glVisual->redBits == 8) {
- if (glVisual->alphaBits == 8)
- stVisual->color_format = PIPE_FORMAT_A8R8G8B8_UNORM;
- else
- stVisual->color_format = PIPE_FORMAT_X8R8G8B8_UNORM;
- } else {
- // TODO: I think this should be RGB vs BGR
- stVisual->color_format = PIPE_FORMAT_B5G6R5_UNORM;
- }
-
- // Determine depth stencil format
- switch (glVisual->depthBits) {
- default:
- case 0:
- stVisual->depth_stencil_format = PIPE_FORMAT_NONE;
- break;
- case 16:
- stVisual->depth_stencil_format = PIPE_FORMAT_Z16_UNORM;
- break;
- case 24:
- if (glVisual->stencilBits == 0) {
- stVisual->depth_stencil_format = PIPE_FORMAT_X8Z24_UNORM;
- } else {
- stVisual->depth_stencil_format = PIPE_FORMAT_S8_UINT_Z24_UNORM;
- }
- break;
- case 32:
- stVisual->depth_stencil_format = PIPE_FORMAT_Z32_UNORM;
- break;
- }
-
- stVisual->accum_format = (glVisual->haveAccumBuffer)
- ? PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
-
- stVisual->buffer_mask |= ST_ATTACHMENT_FRONT_LEFT_MASK;
- stVisual->render_buffer = ST_ATTACHMENT_FRONT_LEFT;
- if (glVisual->doubleBufferMode) {
- stVisual->buffer_mask |= ST_ATTACHMENT_BACK_LEFT_MASK;
- stVisual->render_buffer = ST_ATTACHMENT_BACK_LEFT;
- }
-
- if (glVisual->stereoMode) {
- stVisual->buffer_mask |= ST_ATTACHMENT_FRONT_RIGHT_MASK;
- if (glVisual->doubleBufferMode)
- stVisual->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
- }
-
- if (glVisual->haveDepthBuffer || glVisual->haveStencilBuffer)
- stVisual->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
-
- return stVisual;
-}
-
-
-static int
-hook_stm_get_param(struct st_manager *smapi, enum st_manager_param param)
-{
- CALLED();
-
- switch (param) {
- case ST_MANAGER_BROKEN_INVALIDATE:
- TRACE("%s: TODO: How should we handle BROKEN_INVALIDATE calls?\n",
- __func__);
- // For now we force validation of the framebuffer.
- return 1;
- }
-
- return 0;
-}
-
-