From 3edd57aaa4e37ddc917a3301d03e106e05ac168a Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 30 Apr 2009 20:38:18 -0500 Subject: [PATCH] eliminate windows.opengl32 dependency from opengl.gl.windows so we can use opengl.gl.extensions to define wgl extensions --- basis/opengl/gl/windows/windows.factor | 7 ++++++- basis/windows/opengl32/opengl32.factor | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/basis/opengl/gl/windows/windows.factor b/basis/opengl/gl/windows/windows.factor index 8f48f60d3c..c8a179edf5 100644 --- a/basis/opengl/gl/windows/windows.factor +++ b/basis/opengl/gl/windows/windows.factor @@ -1,6 +1,11 @@ -USING: kernel windows.opengl32 ; +USING: alien.syntax kernel windows.types ; IN: opengl.gl.windows +LIBRARY: gl + +FUNCTION: HGLRC wglGetCurrentContext ( ) ; +FUNCTION: void* wglGetProcAddress ( char* name ) ; + : gl-function-context ( -- context ) wglGetCurrentContext ; inline : gl-function-address ( name -- address ) wglGetProcAddress ; inline : gl-function-calling-convention ( -- str ) "stdcall" ; inline diff --git a/basis/windows/opengl32/opengl32.factor b/basis/windows/opengl32/opengl32.factor index d0b396eba2..f63a4a956a 100755 --- a/basis/windows/opengl32/opengl32.factor +++ b/basis/windows/opengl32/opengl32.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.syntax parser namespaces kernel -math math.bitwise windows.types windows.types init assocs -sequences libc ; +math math.bitwise windows.types init assocs +sequences libc opengl.gl ; IN: windows.opengl32 ! PIXELFORMATDESCRIPTOR flags @@ -100,5 +100,6 @@ LIBRARY: gl FUNCTION: HGLRC wglCreateContext ( HDC hDC ) ; FUNCTION: BOOL wglDeleteContext ( HGLRC hRC ) ; FUNCTION: BOOL wglMakeCurrent ( HDC hDC, HGLRC hglrc ) ; + FUNCTION: HGLRC wglGetCurrentContext ( ) ; FUNCTION: void* wglGetProcAddress ( char* name ) ; -- 2.34.1