scons: Build classic mesa gdi driver.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 23 Apr 2011 11:41:28 +0000 (12:41 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 23 Apr 2011 11:41:28 +0000 (12:41 +0100)
Build as

  scons platform=windows mesagdi

src/mesa/drivers/SConscript
src/mesa/drivers/windows/gdi/SConscript [new file with mode: 0644]
src/mesa/drivers/windows/gdi/mesa.def
src/mesa/drivers/windows/gdi/wgl.c
src/mesa/drivers/windows/gdi/wmesa.c
src/mesa/drivers/windows/gdi/wmesadef.h

index 82159b65f56edefbebcdbb6660e1556701a5d7bc..ab0f894329060129bc07d10719ada0d3fae40510 100644 (file)
@@ -1 +1,6 @@
+Import('*')
+
 SConscript('osmesa/SConscript')
+
+if env['platform'] == 'windows':
+    SConscript('windows/gdi/SConscript')
diff --git a/src/mesa/drivers/windows/gdi/SConscript b/src/mesa/drivers/windows/gdi/SConscript
new file mode 100644 (file)
index 0000000..10a7eea
--- /dev/null
@@ -0,0 +1,38 @@
+Import('*')
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+    '#src/mapi',
+    '#src/mesa',
+])
+
+env.AppendUnique(CPPDEFINES = [
+    '_GDI32_', # prevent wgl* being declared __declspec(dllimport)
+    'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 
+])
+if not env['gles']:
+    # prevent _glapi_* from being declared __declspec(dllimport)
+    env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+
+env.Prepend(LIBS = [
+    glapi,
+    mesa,
+    glsl,
+    'gdi32',
+    'user32',
+    'kernel32',
+])
+
+sources = [
+    'mesa.def',
+    'wgl.c',
+    'wmesa.c',
+]
+
+mesagdi = env.SharedLibrary(
+    target = 'opengl32',
+    source = sources,
+)
+
+env.Alias('mesagdi', mesagdi)
index b537b3460c507a46b0cfa2c47509cf54a519df1f..d5c98801d32dfa30c0e44f1d9b44f59db4568032 100644 (file)
@@ -26,9 +26,6 @@ VERSION 6.5
 ; be needed (for the gl* functions) since the entry
 ; points are compiled with dllexport declspec.
 ;
-; However, this file is still needed to export "internal"
-; Mesa symbols for the benefit of the OSMESA32.DLL.
-;
 EXPORTS
        glNewList
        glEndList
@@ -857,107 +854,3 @@ EXPORTS
        wglUseFontOutlinesA
        wglUseFontOutlinesW
        wglGetExtensionsStringARB
-;
-; Mesa internals - mostly for OSMESA
-       _vbo_CreateContext
-       _vbo_DestroyContext
-       _vbo_InvalidateState
-       _glapi_check_multithread
-       _glapi_get_context
-       _glapi_get_proc_address
-       _mesa_add_soft_renderbuffers
-       _mesa_add_renderbuffer
-       _mesa_check_conditional_render
-       _mesa_choose_tex_format
-       _mesa_create_framebuffer
-       _mesa_create_visual
-       _mesa_delete_array_object
-       _mesa_delete_program
-       _mesa_delete_texture_object
-       _mesa_destroy_framebuffer
-       _mesa_destroy_visual
-       _mesa_enable_1_3_extensions
-       _mesa_enable_1_4_extensions
-       _mesa_enable_1_5_extensions
-       _mesa_enable_2_0_extensions
-       _mesa_enable_2_1_extensions
-       _mesa_enable_sw_extensions
-       _mesa_error
-       _mesa_finish_render_texture
-       _mesa_framebuffer_renderbuffer
-       _mesa_free_context_data
-       _mesa_free_texture_image_data
-       _mesa_generate_mipmap
-       _mesa_get_compressed_teximage
-       _mesa_get_current_context
-       _mesa_get_teximage
-       _mesa_init_driver_functions
-       _mesa_init_glsl_driver_functions
-       _mesa_init_renderbuffer
-       _mesa_initialize_context
-       _mesa_make_current
-       _mesa_new_array_object
-       _mesa_new_framebuffer
-       _mesa_new_program
-       _mesa_new_renderbuffer
-       _mesa_new_soft_renderbuffer
-       _mesa_new_texture_image
-       _mesa_new_texture_object
-       _mesa_problem
-       _mesa_reference_renderbuffer
-       _mesa_remove_renderbuffer
-       _mesa_render_texture
-       _mesa_ResizeBuffersMESA
-       _mesa_resize_framebuffer
-       _mesa_store_compressed_teximage1d
-       _mesa_store_compressed_teximage2d
-       _mesa_store_compressed_teximage3d
-       _mesa_store_compressed_texsubimage1d
-       _mesa_store_compressed_texsubimage2d
-       _mesa_store_compressed_texsubimage3d
-       _mesa_store_teximage1d
-       _mesa_store_teximage2d
-       _mesa_store_teximage3d
-       _mesa_store_texsubimage1d
-       _mesa_store_texsubimage2d
-       _mesa_store_texsubimage3d
-       _mesa_test_proxy_teximage
-       _mesa_reference_framebuffer
-       _mesa_update_framebuffer_visual
-       _mesa_use_program
-       _mesa_Viewport
-       _mesa_meta_init
-       _mesa_meta_free
-       _mesa_meta_CopyColorSubTable
-       _mesa_meta_CopyColorTable
-       _mesa_meta_CopyConvolutionFilter1D
-       _mesa_meta_CopyConvolutionFilter2D
-       _mesa_meta_CopyTexImage1D
-       _mesa_meta_CopyTexImage2D
-       _mesa_meta_CopyTexSubImage1D
-       _mesa_meta_CopyTexSubImage2D
-       _mesa_meta_CopyTexSubImage3D
-       _swrast_Accum
-       _swrast_Bitmap
-       _swrast_BlitFramebuffer
-       _swrast_CopyPixels
-       _swrast_DrawPixels
-       _swrast_GetDeviceDriverReference
-       _swrast_Clear
-       _swrast_choose_line
-       _swrast_choose_triangle
-       _swrast_CreateContext
-       _swrast_DestroyContext
-       _swrast_exec_fragment_program
-       _swrast_InvalidateState
-       _swrast_ReadPixels
-       _swsetup_Wakeup
-       _swsetup_CreateContext
-       _swsetup_DestroyContext
-       _swsetup_InvalidateState
-       _tnl_CreateContext
-       _tnl_DestroyContext
-       _tnl_InvalidateState
-       _tnl_run_pipeline
-       _tnl_program_string
-       _tnl_RasterPos
index 8d8087067f5c52ba24716b290988af567836942a..1dafe6e2952ea1952b45f608a2884ab585f17ebb 100644 (file)
@@ -54,8 +54,8 @@
 #include <windows.h>
 
 #endif
-#include "config.h"
-#include "glapi.h"
+#include "main/config.h"
+#include "glapi/glapi.h"
 #include "GL/wmesa.h"   /* protos for wmesa* functions */
 
 /*
index 4a8b1b283d50135a169ba47f16e7c59555f05926..e3a37eb1acefabd6c34f4d6d82e8fb5e1e8be218 100644 (file)
@@ -7,10 +7,11 @@
 #include "colors.h"
 #include <GL/wmesa.h>
 #include <winuser.h>
-#include "context.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/macros.h"
 #include "drivers/common/driverfuncs.h"
 #include "drivers/common/meta.h"
 #include "vbo/vbo.h"
@@ -185,7 +186,7 @@ BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize)
 }
 
 
-static wmDeleteBackingStore(WMesaFramebuffer pwfb)
+static void wmDeleteBackingStore(WMesaFramebuffer pwfb)
 {
     if (pwfb->hbmDIB) {
        SelectObject(pwfb->dib_hDC, pwfb->hOldBitmap);
index a73609b007a2a0078e0ad329a339b888ed288cbe..32289ebc70080852931dd6344687670a55d8c84e 100644 (file)
@@ -3,7 +3,7 @@
 #ifdef __MINGW32__
 #include <windows.h>
 #endif
-#include "context.h"
+#include "main/context.h"
 
 
 /**