wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.78k stars 1.7k forks source link

Opengl ES integration for wince. Wince specific canvas code. #9099

Closed wxtrac closed 2 years ago

wxtrac commented 16 years ago

Issue migrated from trac ticket # 9099

component: OpenGL | priority: normal

2008-03-28 20:51:17: selcukcihan created the issue


Three files introduced to replace glcanvas files when building for wince. Basically, glcanvaswince. are the counterparts of glcanvas. files, targeting Opengl ES.

include/wx/glcanvaswince.h is wrapper which includes the target specific header include/wx/msw/glcanvaswince.h

src/msw/glcanvaswince.cpp is the corresponding implementation file.

I have coded wince specific glcanvas such that it uses Opengl ES implementation provided by vincent http://sourceforge.net/projects/ogl-es

The main differences compared to original glcanvas are in wxGLContext class. Since windows mobile does not have wgl* family of functions, i have used EGL api to create egl contexts and such.

Another issue is wince lacks functions such as DescribePixelFormat, SetPixelFormat etc.; so i have excluded portions of code creating and setting palettes.

One last thing, wxGLApp::InitGLVisual code uses pixel format stuff which i have excluded, that is why i just return false in InitGLVisual function.

This patch is just a startup allowing OpenglES support to be added to wxGLCanvas and related context classes. I am currently using this patch and it works fine, but much more work is needed, especially to set up different device context configurations etc.

Final remark, i have developed the code in wxWidgets-2.8.5 branch, but i have generated the patch against the trunk.

wxtrac commented 16 years ago

2008-03-28 20:51:19: selcukcihan uploaded file glcanvaswince.patch (31.9 KiB)

Patch adding Opengl ES capability for wince.

wxtrac commented 16 years ago

2008-04-06 18:20:14: @vadz commented


Thanks for your contribution but unfortunately it really can't be applied in its current state: there is too much duplicated code compared with the MSW version (and to add insult to injury puts "#if 0" around much of it) and we can't have this. I guess we'd need to either refactor the code to have a common base class for both Win32 and WinCE versions or, if this is simpler for you, maybe put "#ifdef WXWINCE"s directly in src/msw/glcanvas.cpp. I'd prefer the former but the latter is still better than just copying the file and then modifying parts of it.

Could you please update your patch in one of those ways (or another one if you can think of some other approach avoiding the code duplication)? If you have any questions please don't hesitate to post to wx-dev. Thanks!

wxtrac commented 16 years ago

2008-04-21 04:20:24: sf-robot commented


This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).