I have made a patch. You have to patch your Clanlib if you work in branch CL07 of wormux to have wormux working well. This patch contain my precedent patch of Clanlib so you need only it.
# Old manifest: bc85a4a4840d5a7a9dbcde294949e0935f81cef0
# New manifest: 322f50deeed0c7631ea5db0c5b40ebba1ca17621
# Summary of changes:
# 
#   patch Sources/GL/GLX/display_window_opengl.cpp
#    from 1fc9999cc2e9784de9eda914a98d4109ef9f98a7
#      to 4d36b1a365c5915c0419fb527d6bbabc3222d5e4
# 
#   patch Sources/GL/GLX/display_window_opengl.h
#    from 2abd9c0f52bd339b4a78d2fd0a03819df849e882
#      to 5e28145d225cf2b04e5b35999a1d608c3eb22330
# 
#   patch configure.ac
#    from ced76aaca25273cd6682adc91db2413620e5940e
#      to 64700d7fd2ab95c616d9de3e3e1f29fd6258003d
# 
--- Sources/GL/GLX/display_window_opengl.cpp
+++ Sources/GL/GLX/display_window_opengl.cpp
@@ -43,7 +43,10 @@
 #include "../opengl_window_description_generic.h"
 #include <unistd.h>
 
+#include <X11/extensions/Xrandr.h>
 
+
+
 GLXContext CL_DisplayWindow_OpenGL::share_context = 0;
 
 Display *CL_DisplayWindow_OpenGL::disp = 0;
@@ -266,7 +269,7 @@
        set_title(desc.get_title());
        
        // setup size hints:
-       XSizeHints size_hints;
+
        memset(&size_hints, 0, sizeof(XSizeHints));
        size_hints.width = desc.get_size().width;
        size_hints.height = desc.get_size().height;
@@ -443,6 +443,7 @@
        if(fullscreen)
                return;
 
+
        // Vid-mode Switching
        int num_modes;
        XF86VidModeModeInfo **modes;
@@ -480,11 +481,11 @@
        }
        
        if(!width)
-               width = get_width();
+               width = fullscreen_width;
 
        if(!height)
-               height = get_height();
-
+               height = fullscreen_height;
+       
        if(!bpp)
                bpp = glx_bpp;
 
@@ -539,6 +539,8 @@
 
        XSync(disp, True);
 
+       set_size(width,height);
+
        fullscreen = true;
 }
 
@@ -551,7 +553,7 @@
        XUnmapWindow(disp, window);
        XSync(disp, True);
 
-       // Turn on WM control
+       // Turn on WM control 
        attributes.override_redirect = False;
        XChangeWindowAttributes(disp, window, CWBorderPixel | CWColormap | 
CWOverrideRedirect, &attributes);
 
@@ -595,6 +595,39 @@
 {
        fullscreen_width = width;
        fullscreen_height = height;
+       size_hints.width = width;
+       size_hints.height = height;
+       size_hints.base_width = width;
+       size_hints.base_height = height;
+       size_hints.min_width = width;
+       size_hints.min_height = height;
+       size_hints.max_width = width;
+       size_hints.max_height = height;
+       
+       if(fullscreen)
+         {
+           // Test
+           XRRScreenConfiguration* 
conf=XRRGetScreenInfo(disp,DefaultRootWindow(disp));
+           int nbSize;
+           Rotation rotation;
+           XRRScreenSize* sizes=XRRSizes(disp,XDefaultScreen(disp),&nbSize);
+           XRRRotations(disp,XDefaultScreen(disp),&rotation);
+           int size=-1;
+           for(int index=0;index<nbSize;++index)
+             {
+               if(sizes[index].width==width && sizes[index].height==height)
+                 {
+                   size=index;
+                   break;
+                 }
+             }
+           if(size!=-1)
+             
XRRSetScreenConfig(disp,conf,DefaultRootWindow(disp),size,1,CurrentTime);
+           else printf("Sizes not supported\n");
+         }
+       XResizeWindow(disp, window, width, height);
+       XSetWMNormalHints(disp, window, &size_hints);
+     
        sig_resize(width, height);
 }
 
--- Sources/GL/GLX/display_window_opengl.h
+++ Sources/GL/GLX/display_window_opengl.h
@@ -212,6 +212,9 @@
        //: Handle to X11 window.
        Window window;
 
+       //: Size Hints
+       XSizeHints size_hints;
+
        //: Attributes used to create window.
        XSetWindowAttributes attributes;
        
--- configure.ac
+++ configure.ac
@@ -84,7 +84,7 @@
         extra_CFLAGS_clanApp="-mwindows"
         extra_LIBS_clanCore="-lz"
         extra_LIBS_clanDisplay="-lwinmm -lddraw -ldinput8 -ldxguid -lgdi32 
-lole32 -ljpeg -lpng"
-        extra_LIBS_clanGL="-lopengl32 -lglu32"
+        extra_LIBS_clanGL="-lopengl32 -lglu32 -lRrandr"
         extra_LIBS_clanSound="-ldsound -ldxguid -lwinmm"
         extra_LIBS_clanMikMod="-lmikmod"
         extra_LIBS_clanVorbis="-lvorbis -logg"

Répondre à