PWGL, some improvements

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

Hi,
few months ago I started a thread about running PWGL under wine. PWGL is a "
free cross-platform visual language based on Common Lisp, CLOS and OpenGL,
specialized in computer aided composition and sound synthesis. "
http://www2.siba.fi/PWGL/index.html
However, because I had to use winetricks to install Microsoft Visual C++
2005 (it's needed by PWGL), and the many errors that I got running PWGL, I
stopped investigating further.

However, today I installed wine 1.1.8 under Ubuntu 8.04 and the situation
looks promising: I could install Visual C++ Redistributable without
winetricks, and PWGL runs much better (with almost no error messages).
In fact everything seems to work, the program loads correctly, but the
screen looks still completely broken (black with few random colored lines).
Anyway, the mouse react correctly to the objects (even if I cannot see
them), and, exporting the screen to EPS (from the software), I can see that
PWGL works.

Saving the terminal output to a log.txt file, shows only 2 errors related to
wine:
fixme:reg:GetNativeSystemInfo (0x5422c8) using GetSystemInfo()
... (here lots of pwgl loading infos)
err:wgl:X11DRV_wglShareLists Could not share display lists, context already
created !

I also ran WINEDEBUG=+relay,+seh,+tid wine PWGL-1-0b.exe &> /tmp/output.txt
as suggested in the FAQ, should I attach it to this mailing list?

It would be really nice to have this app working under linux, I made today a
submission for this application in the AppDB, and asked to be a maintainer.

Unfortunately I'm not a programmer so I cannot help providing any code, but
I can test and provide reports.
Thanks for your attention,
Best regards,

Libero Mureddu

--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 40662.html
Sent from the Wine - Users mailing list archive at Nabble.com.
qwertymn
Level 4
Level 4
Posts: 236
Joined: Thu Mar 27, 2008 3:42 am

Post by qwertymn »

Hi, this sounds very much like the same bug like in for example GameTap. Could you try if the patch at
http://www.winehq.org/pipermail/wine-pa ... 62880.html works? If I remember correctly it worked OK for GameTap, maybe you might be lucky as well ;)
qwertymn
Level 4
Level 4
Posts: 236
Joined: Thu Mar 27, 2008 3:42 am

Post by qwertymn »

Sorry, this was the patch that made gametap work, rediffed against curretn git:

Code: Select all

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b4845ad..06c20ea 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1863,27 +1863,35 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
     if (!has_opengl()) return FALSE;
 
     if (NULL != dest && dest->ctx != NULL) {
-        ERR("Could not share display lists, context already created !\n");
-        return FALSE;
-    } else {
-        if (org->ctx == NULL) {
-            int indirect = (GetObjectType(org->hdc) == OBJ_MEMDC);
-            wine_tsx11_lock();
-            describeContext(org);
+            WARN("Destination context already created, destroying it\n");
+        pglXDestroyContext(gdi_display, dest->ctx);
+       dest->ctx = NULL;
+    }
+    if (org->ctx == NULL) {
+        int indirect = (GetObjectType(org->hdc) == OBJ_MEMDC);
+       wine_tsx11_lock();
+       describeContext(org);
+
+       if(org->vis)
+           org->ctx = pglXCreateContext(gdi_display, org->vis, NULL, !indirect);
+       else /* Create a GLX Context for a pbuffer */
+           org->ctx = pglXCreateNewContext(gdi_display, org->fmt->fbconfig, org->fmt->render_type, NULL, True);
+       wine_tsx11_unlock();
+       TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
+    }
+    if (NULL != dest) {
+        int indirect = (GetObjectType(dest->hdc) == OBJ_MEMDC);
+       wine_tsx11_lock();
+       describeContext(dest);
+       /* Create the destination context with display lists shared */
+       if(dest->vis)
+           dest->ctx = pglXCreateContext(gdi_display, dest->vis, org->ctx, !indirect);
+       else /* Create a GLX Context for a pbuffer */
+           dest->ctx = pglXCreateNewContext(gdi_display, dest->fmt->fbconfig, dest->fmt->render_type, org->ctx, True);
+       wine_tsx11_unlock();
+       TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
+       return TRUE;
 
-            org->ctx = create_glxcontext(gdi_display, org, NULL, !indirect);
-            wine_tsx11_unlock();
-            TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
-        }
-        if (NULL != dest) {
-            int indirect = (GetObjectType(dest->hdc) == OBJ_MEMDC);
-            wine_tsx11_lock();
-            describeContext(dest);
-            dest->ctx = create_glxcontext(gdi_display, dest, org->ctx, !indirect);
-            wine_tsx11_unlock();
-            TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
-            return TRUE;
-        }
     }
     return FALSE;
 }


Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

sainath wrote:
Sorry, this was the patch that made gametap work, rediffed against curretn
git:
Thanks for your answer, I'll try now to build wine from source (i'm using a
binary atm), and try the patch.
Thanks a lot,
Libero

--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 57901.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

Hi,
I applied the patch, but the screen shows the same problem; however, I don't
get anymore an error from the terminal.
Is there anything else that I could try?

Thanks a lot,
Libero
--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 60072.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

Wine 1.1.9 compiled from GIT gives the same error (screen not readable).

--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 58734.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

Could you attach a screenshot of the problem? Note that patch is very hacky and is very likely not to work for you. The problem is that on Linux and Windows there is a slight difference in GLX and WGL on how to set up OpenGL.

When an app wants to use OpenGL it needs to create a so called 'opengl context'. In its most simple form you use one context for each window (though they can be shared if the pixel formats are the same). Most of the time you want to share resources (e.g. textures) between contexts and for that purpose you use 'wglShareLists' on Windows. In case of GLX sharing 'display lists' between context needs to be done at context creation time.

So Windows does:
ctx1 = wglCreateContext(..)
ctx2 = wglCreateContext(..)
wglShareLists(ctx1, ctx2)

On Linux you do:
ctx1 = glxCreateContext(NULL)
ctx2 = glXCreateContext(ctx1)

In order to emulate wglShareLists we don't directly create a GLX context when wglCreateContext is called but delay this until it is used or when wglShareLists is called. This makes most apps happy but if a program uses a bad 'pattern' it can cause drawing issues in programs.

Assuming your issue is opengl related, the program is likely using a bad pattern.
Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

stfudonny wrote:
Could you attach a screenshot of the problem? Note that patch is very
hacky and is very likely not to work for you.
...
Assuming your issue is opengl related, the program is likely using a bad
pattern.
Hi,
I made two screenshots: the first under windows and it shows how the app
should look, the second one was made under wine 1.1.9.

http://www.nabble.com/file/p20661078/pwgl-windows.jpg
http://www.nabble.com/file/p20661078/pwgl-wine.png
--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 61078.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

Let me guess you are using a non-Nvidia driver? The program uses child window opengl rendering and for that we use X features which are not all implemented properly by all drivers yet. When intel/ati drivers move to DRI2 they should also work fine.
qwertymn
Level 4
Level 4
Posts: 236
Joined: Thu Mar 27, 2008 3:42 am

Post by qwertymn »

I can confirm it works (better) on nvidia-card (i have geforce 8600) See image. I still needed the earlier patch, otherwise i didn't see any text...

Image

Image
Libero Mureddu

PWGL, some improvements

Post by Libero Mureddu »

axept wrote:
I can confirm it works (better) on nvidia-card (i have geforce 8600) See
image. I still needed the earlier patch, otherwise i didn't see any
text...

[Image: http://img60.imageshack.us/img60/5516/aqex5.jpg ]
(http://imageshack.us)

[Image: http://img60.imageshack.us/img60/aqex5.jpg/1/w1024.png ]
(http://g.imageshack.us/img60/aqex5.jpg/1/)

Thanks a lot, it's nice to see it 'almost' working!!!
I confirm I have Intel GMA 3100.
regards,
Libero





--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 66750.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

It would be nice if the PWGL guys rewrite their code to behave properly as this code is very dangerous.

I expect they are doing:
src = wglCreateContext(..)
dest = wglCreateContext(..)
wglMakeCurrent(dest)
do_some_gl_rendering
wglShareLists(src, dest)

A requirement for the call is that you didn't do anything with the destination context before calling wglShareLists. If they would swap around the parameters in the call it would work fine or even better directly call share lists after creating the contexts.
alexandre_ficagna

PWGL, some improvements

Post by alexandre_ficagna »

Hi, I've got the same problem here.

I've been talking with Libero by mail, and we've got the same problem. My
video card is also intel: Mobile Intel Graphic Media Accelerator X3100 (GMA
X3100). Saw the screenshots: my screen looks almost the same.
I've tried Wine 0.9.5 untill 1.1.9 versions, with Directx, then with Directx
and winetricks, trying to do the same configuration required by some
powerful games, but nothing really changed... Now I'm using a Ubuntu 8.04,
but before I was in a 7.10 version.

Last time I've tried this:
http://howto.landure.fr/gnu-linux/insta ... using-wine
I also saw this, but didn't tried (don't feel this is the problem, but..):
http://wiki.winehq.org/UsefulRegistryKeys

[]s
Alexandre Ficagna


Libero Mureddu wrote:
Hi,
few months ago I started a thread about running PWGL under wine. PWGL is a
" free cross-platform visual language based on Common Lisp, CLOS and
OpenGL, specialized in computer aided composition and sound synthesis. "
http://www2.siba.fi/PWGL/index.html
However, because I had to use winetricks to install Microsoft Visual C++
2005 (it's needed by PWGL), and the many errors that I got running PWGL, I
stopped investigating further.

However, today I installed wine 1.1.8 under Ubuntu 8.04 and the situation
looks promising: I could install Visual C++ Redistributable without
winetricks, and PWGL runs much better (with almost no error messages).
In fact everything seems to work, the program loads correctly, but the
screen looks still completely broken (black with few random colored
lines). Anyway, the mouse react correctly to the objects (even if I cannot
see them), and, exporting the screen to EPS (from the software), I can see
that PWGL works.

Saving the terminal output to a log.txt file, shows only 2 errors related
to wine:
fixme:reg:GetNativeSystemInfo (0x5422c8) using GetSystemInfo()
... (here lots of pwgl loading infos)
err:wgl:X11DRV_wglShareLists Could not share display lists, context
already created !

I also ran WINEDEBUG=+relay,+seh,+tid wine PWGL-1-0b.exe &>
/tmp/output.txt as suggested in the FAQ, should I attach it to this
mailing list?

It would be really nice to have this app working under linux, I made today
a submission for this application in the AppDB, and asked to be a
maintainer.

Unfortunately I'm not a programmer so I cannot help providing any code,
but I can test and provide reports.
Thanks for your attention,
Best regards,

Libero Mureddu

--
View this message in context: http://www.nabble.com/PWGL%2C-some-impr ... 72128.html
Sent from the Wine - Users mailing list archive at Nabble.com.
Locked