[waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window
Emil Velikov
emil.l.velikov at gmail.com
Sat May 31 14:02:46 PDT 2014
On 31/05/14 19:59, Jose Fonseca wrote:
> ----- Original Message -----
>> On 24/05/14 20:28, Emil Velikov wrote:
[snip]
>>
>> AFAICS waffle is unique wrt other projects (apitrace, epoxy, glut) as it
>> allows the PixelFormat to be called prior to the creation of either window or
>> context.
>>
>>> Options:
>>> - Create a window, choose format, destroy window.
>>> No guarantee that the function will behave the same for another
>>> window/device_context.
>
> In practice, the odds of this happening are very low.
>
> I'd recommend creating an invisible window, do your things then, keep the window around, and then merely double check later that things are not busted.
>
Still not sure which one of the two you are recommending:
"Create a invisible(dummy) window initially and create a new one at
wfl_window_create." or
"Create a invisible(dummy) window initially and bring it up/use it at
wfl_window_create/wfl_window_show." ?
Pardon if the above question sound rather dull :)
Thanks
Emil
> You can see in http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/wgl/stw_ext_pbuffer.c how to create an invisible window (This is how Mesa implements pbuffers on Windows!.)
>
> Jose
>
>>> - or, create window, choose format, reuse window on
>>> waffle_window_create()
>>> Sanest solution. If windows is not created just make one (i.e.
>>> waffle_config_choose is not executed before
>>> waffle_window_create).
>>>
>>> - or, store the attributes, and invoke ChoosePixelFormat as
>>> waffle_window_create is executed.
>>> What if code-flow depends on waffle_config_choose's return value
>>> ?
>>>
>>> - or rework waffle API ... (no, please no)
>>>
>>> Suggestion:
>>> "Cache" the window, and reuse it on waffle_window_create.
>>>
More information about the waffle
mailing list