0

I want to use UpdateLayeredWindow for a Win32 window that will be drawn with OpenGL. It seems that I have to create the context to a bitmap ( I will then pass this bitmap to UpdateLayeredWindow() ) unstead of to a window. But do I still need the double buffer flag ( at the context creation with wgl ) ? as the bitmap is a buffer.

Also what is the effect of the WS_EX_NOREDIRECTIONBITMAP ? If it just prevents the creation of the 2 nd buffer there are two cases :

  • OpenGL double buffer + WS_EX_NOREDIRECTIONBITMAP = 2 buffers

  • OpenGL single buffer + i dont use the flag = 2 buffers

In both case there are 2 buffers. What is the best ?

  • There really should be some practical effort at coding before posting this question. I see you are using phrases like _It seems that I have to_, instead of phrases like _This is what I've observed when I tried..._ Please show your work thus far, point to exactly what the problem is, and it would be best if the code you show is in the form of a [mcve]. For now I have to vote to close for the reason [that this question is off-topic for this site](https://stackoverflow.com/help/on-topic) – ryyker Apr 02 '20 at 14:43
  • I'm voting to close this question as off-topic because question needs to provide evidence of actual attempt, and more specificity about what the problem is. – ryyker Apr 02 '20 at 14:49
  • I don't know what i have to do tha'ts why I'm asking I did lost of test and read the docs but i don't know how does updatelayeredwindows works i can't give more informations. please just anser. Also if what i do works it does not means it's a good way of doing it –  Apr 02 '20 at 15:02
  • A series of well stated Google queries will yield the answers you need to the questions you've asked here. That's what I do on the occasion that I am doing something new to me. This site is really for targeted problems encountered when actually running into buggy software behavior, failure to compile, questions about things that are in the process of being built, etc. You are still in the learning phase. i.e. you have not written anything (or posted anything) yet. I cannot help to solve a problem that does not yet exist. – ryyker Apr 02 '20 at 16:15
  • I've only been doing this for 3 days –  Apr 02 '20 at 16:24
  • Then you've more reading and studying to do before your ready to code. And coding something is a prerequisite for using this site Look for some OpenGL tutorials. – ryyker Apr 02 '20 at 16:29
  • ...[such as this link](https://www.prasannavl.com/2016/10/introducing-winapi-graphics-with-direct3d-d2d1-gdi-opengl-and-skia/) – ryyker Apr 02 '20 at 16:31
  • I know how OpenGL works i don't know how win32 works. I just want an anser : yes or no. –  Apr 02 '20 at 16:34
  • If you're looking to evaluate performance then there's only one way to know for sure: Try it both ways and compare. You said don't know how does `updatelayeredwindows` works, please see [How to use LayeredWindows properly](https://stackoverflow.com/a/10449503/11128312) and [Draw HBITMAP onto layered window](https://stackoverflow.com/a/12627383/11128312) – Strive Sun Apr 03 '20 at 08:57
  • nothing related to the question so far... –  Apr 03 '20 at 13:24

0 Answers0