~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/gallium/frontends/wgl/stw_ext_pbuffer.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
struct stw_framebuffer *
71
71
stw_pbuffer_create(const struct stw_pixelformat_info *pfi, int iWidth, int iHeight, struct pipe_frontend_screen *fscreen)
72
72
{
73
 
   static boolean first = TRUE;
 
73
   static bool first = true;
74
74
 
75
75
   /*
76
76
    * Implement pbuffers through invisible windows
88
88
      wc.lpszClassName = "wglpbuffer";
89
89
      wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
90
90
      RegisterClass(&wc);
91
 
      first = FALSE;
 
91
      first = false;
92
92
   }
93
93
 
94
94
   DWORD dwExStyle = 0;
117
117
    * WS_OVERLAPPEDWINDOW or WS_POPUPWINDOW as above.
118
118
    */
119
119
 
120
 
   AdjustWindowRectEx(&rect, dwStyle, FALSE, dwExStyle);
 
120
   AdjustWindowRectEx(&rect, dwStyle, false, dwExStyle);
121
121
 
122
122
   HWND hWnd = CreateWindowEx(dwExStyle,
123
123
                              "wglpbuffer", /* wc.lpszClassName */
167
167
   BOOL bRet;
168
168
   int textureFormat = WGL_NO_TEXTURE_ARB;
169
169
   int textureTarget = WGL_NO_TEXTURE_ARB;
170
 
   BOOL textureMipmap = FALSE;
 
170
   BOOL textureMipmap = false;
171
171
   const struct stw_pixelformat_info *pfi = stw_pixelformat_get_info(iPixelFormat);
172
172
 
173
173
   if (!pfi) {
316
316
 
317
317
   if (!hPbuffer) {
318
318
      SetLastError(ERROR_INVALID_HANDLE);
319
 
      return FALSE;
 
319
      return false;
320
320
   }
321
321
 
322
322
   fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
335
335
 
336
336
   if (!hPbuffer) {
337
337
      SetLastError(ERROR_INVALID_HANDLE);
338
 
      return FALSE;
 
338
      return false;
339
339
   }
340
340
 
341
341
   fb = stw_framebuffer_from_HPBUFFERARB(hPbuffer);
343
343
   switch (iAttribute) {
344
344
   case WGL_PBUFFER_WIDTH_ARB:
345
345
      *piValue = fb->width;
346
 
      return TRUE;
 
346
      return true;
347
347
   case WGL_PBUFFER_HEIGHT_ARB:
348
348
      *piValue = fb->height;
349
 
      return TRUE;
 
349
      return true;
350
350
   case WGL_PBUFFER_LOST_ARB:
351
351
      /* We assume that no content is ever lost due to display mode change */
352
 
      *piValue = FALSE;
353
 
      return TRUE;
 
352
      *piValue = false;
 
353
      return true;
354
354
   /* WGL_ARB_render_texture */
355
355
   case WGL_TEXTURE_TARGET_ARB:
356
356
      *piValue = fb->textureTarget;
357
 
      return TRUE;
 
357
      return true;
358
358
   case WGL_TEXTURE_FORMAT_ARB:
359
359
      *piValue = fb->textureFormat;
360
 
      return TRUE;
 
360
      return true;
361
361
   case WGL_MIPMAP_TEXTURE_ARB:
362
362
      *piValue = fb->textureMipmap;
363
 
      return TRUE;
 
363
      return true;
364
364
   case WGL_MIPMAP_LEVEL_ARB:
365
365
      *piValue = fb->textureLevel;
366
 
      return TRUE;
 
366
      return true;
367
367
   case WGL_CUBE_MAP_FACE_ARB:
368
368
      *piValue = fb->textureFace + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB;
369
 
      return TRUE;
 
369
      return true;
370
370
   default:
371
371
      SetLastError(ERROR_INVALID_DATA);
372
 
      return FALSE;
 
372
      return false;
373
373
   }
374
374
}