Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4eb4546f
Commit
4eb4546f
authored
Mar 07, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Mar 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Implement wglUseFontOutlines.
parent
89b3191c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
6 deletions
+235
-6
configure
configure
+2
-1
configure.ac
configure.ac
+1
-1
opengl32.spec
dlls/opengl32/opengl32.spec
+1
-1
wgl.c
dlls/opengl32/wgl.c
+228
-3
config.h.in
include/config.h.in
+3
-0
No files found.
configure
View file @
4eb4546f
...
...
@@ -8013,7 +8013,8 @@ fi
for
ac_header
in
GL/gl.h GL/glx.h GL/glext.h
for
ac_header
in
GL/gl.h GL/glx.h GL/glext.h GL/glu.h
do
as_ac_Header
=
`
echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
echo
"
$as_me
:
$LINENO
: checking for
$ac_header
"
>
&5
...
...
configure.ac
View file @
4eb4546f
...
...
@@ -373,7 +373,7 @@ then
dnl Check for the presence of OpenGL
if test "x$with_opengl" != "xno"
then
AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h,,,
AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h
GL/glu.h
,,,
[#ifdef HAVE_GL_GLX_H
# include <GL/glx.h>
#endif])
...
...
dlls/opengl32/opengl32.spec
View file @
4eb4546f
...
...
@@ -397,4 +397,4 @@
@ stdcall wglUseFontBitmapsA(long long long long)
@ stdcall wglUseFontBitmapsW(long long long long)
@ stdcall wglUseFontOutlinesA(long long long long long long long ptr)
@ st
ub wglUseFontOutlinesW
@ st
dcall wglUseFontOutlinesW(long long long long long long long ptr)
dlls/opengl32/wgl.c
View file @
4eb4546f
...
...
@@ -34,6 +34,11 @@
#include "wgl_ext.h"
#include "opengl_ext.h"
#ifdef HAVE_GL_GLU_H
#undef far
#undef near
#include <GL/glu.h>
#endif
#include "wine/library.h"
#include "wine/debug.h"
...
...
@@ -864,6 +869,212 @@ BOOL WINAPI wglUseFontBitmapsW(HDC hdc,
return
TRUE
;
}
#ifdef HAVE_GL_GLU_H
static
void
fixed_to_double
(
POINTFX
fixed
,
UINT
em_size
,
GLdouble
vertex
[
3
])
{
vertex
[
0
]
=
(
fixed
.
x
.
value
+
(
GLdouble
)
fixed
.
x
.
fract
/
(
1
<<
16
))
/
em_size
;
vertex
[
1
]
=
(
fixed
.
y
.
value
+
(
GLdouble
)
fixed
.
y
.
fract
/
(
1
<<
16
))
/
em_size
;
vertex
[
2
]
=
0
.
0
;
}
static
void
tess_callback_vertex
(
GLvoid
*
vertex
)
{
GLdouble
*
dbl
=
vertex
;
TRACE
(
"%f, %f, %f
\n
"
,
dbl
[
0
],
dbl
[
1
],
dbl
[
2
]);
glVertex3dv
(
vertex
);
}
static
void
tess_callback_begin
(
GLenum
which
)
{
TRACE
(
"%d
\n
"
,
which
);
glBegin
(
which
);
}
static
void
tess_callback_end
(
void
)
{
TRACE
(
"
\n
"
);
glEnd
();
}
/***********************************************************************
* wglUseFontOutlines_common
*/
BOOL
WINAPI
wglUseFontOutlines_common
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
,
FLOAT
deviation
,
FLOAT
extrusion
,
int
format
,
LPGLYPHMETRICSFLOAT
lpgmf
,
BOOL
unicode
)
{
UINT
glyph
;
const
MAT2
identity
=
{{
0
,
1
},{
0
,
0
},{
0
,
0
},{
0
,
1
}};
GLUtesselator
*
tess
;
LOGFONTW
lf
;
HFONT
old_font
,
unscaled_font
;
UINT
em_size
=
1024
;
RECT
rc
;
TRACE
(
"(%p, %ld, %ld, %ld, %f, %f, %d, %p, %s)
\n
"
,
hdc
,
first
,
count
,
listBase
,
deviation
,
extrusion
,
format
,
lpgmf
,
unicode
?
"W"
:
"A"
);
ENTER_GL
();
tess
=
gluNewTess
();
if
(
tess
)
{
gluTessCallback
(
tess
,
GLU_TESS_VERTEX
,
(
_GLUfuncptr
)
tess_callback_vertex
);
gluTessCallback
(
tess
,
GLU_TESS_BEGIN
,
(
_GLUfuncptr
)
tess_callback_begin
);
gluTessCallback
(
tess
,
GLU_TESS_END
,
tess_callback_end
);
}
LEAVE_GL
();
if
(
!
tess
)
return
FALSE
;
GetObjectW
(
GetCurrentObject
(
hdc
,
OBJ_FONT
),
sizeof
(
lf
),
&
lf
);
rc
.
left
=
rc
.
right
=
rc
.
bottom
=
0
;
rc
.
top
=
em_size
;
DPtoLP
(
hdc
,
(
POINT
*
)
&
rc
,
2
);
lf
.
lfHeight
=
-
abs
(
rc
.
top
-
rc
.
bottom
);
lf
.
lfOrientation
=
lf
.
lfEscapement
=
0
;
unscaled_font
=
CreateFontIndirectW
(
&
lf
);
old_font
=
SelectObject
(
hdc
,
unscaled_font
);
for
(
glyph
=
first
;
glyph
<
first
+
count
;
glyph
++
)
{
DWORD
needed
;
GLYPHMETRICS
gm
;
BYTE
*
buf
;
TTPOLYGONHEADER
*
pph
;
TTPOLYCURVE
*
ppc
;
GLdouble
*
vertices
;
if
(
unicode
)
needed
=
GetGlyphOutlineW
(
hdc
,
glyph
,
GGO_NATIVE
,
&
gm
,
0
,
NULL
,
&
identity
);
else
needed
=
GetGlyphOutlineA
(
hdc
,
glyph
,
GGO_NATIVE
,
&
gm
,
0
,
NULL
,
&
identity
);
if
(
needed
==
GDI_ERROR
)
goto
error
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
vertices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
/
sizeof
(
POINTFX
)
*
3
*
sizeof
(
GLdouble
));
if
(
unicode
)
GetGlyphOutlineW
(
hdc
,
glyph
,
GGO_NATIVE
,
&
gm
,
needed
,
buf
,
&
identity
);
else
GetGlyphOutlineA
(
hdc
,
glyph
,
GGO_NATIVE
,
&
gm
,
needed
,
buf
,
&
identity
);
TRACE
(
"glyph %d
\n
"
,
glyph
);
if
(
lpgmf
)
{
lpgmf
->
gmfBlackBoxX
=
gm
.
gmBlackBoxX
/
em_size
;
lpgmf
->
gmfBlackBoxY
=
gm
.
gmBlackBoxY
/
em_size
;
lpgmf
->
gmfptGlyphOrigin
.
x
=
gm
.
gmptGlyphOrigin
.
x
/
em_size
;
lpgmf
->
gmfptGlyphOrigin
.
y
=
gm
.
gmptGlyphOrigin
.
y
/
em_size
;
lpgmf
->
gmfCellIncX
=
gm
.
gmCellIncX
/
em_size
;
lpgmf
->
gmfCellIncY
=
gm
.
gmCellIncY
/
em_size
;
TRACE
(
"%fx%f at %f,%f inc %f,%f
\n
"
,
lpgmf
->
gmfBlackBoxX
,
lpgmf
->
gmfBlackBoxY
,
lpgmf
->
gmfptGlyphOrigin
.
x
,
lpgmf
->
gmfptGlyphOrigin
.
y
,
lpgmf
->
gmfCellIncX
,
lpgmf
->
gmfCellIncY
);
lpgmf
++
;
}
ENTER_GL
();
glNewList
(
listBase
++
,
GL_COMPILE
);
gluTessBeginPolygon
(
tess
,
NULL
);
pph
=
(
TTPOLYGONHEADER
*
)
buf
;
while
((
BYTE
*
)
pph
<
buf
+
needed
)
{
TRACE
(
"
\t
start %d, %d
\n
"
,
pph
->
pfxStart
.
x
.
value
,
pph
->
pfxStart
.
y
.
value
);
gluTessBeginContour
(
tess
);
fixed_to_double
(
pph
->
pfxStart
,
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
pph
+
sizeof
(
*
pph
));
while
((
char
*
)
ppc
<
(
char
*
)
pph
+
pph
->
cb
)
{
int
i
;
switch
(
ppc
->
wType
)
{
case
TT_PRIM_LINE
:
for
(
i
=
0
;
i
<
ppc
->
cpfx
;
i
++
)
{
TRACE
(
"
\t\t
line to %d, %d
\n
"
,
ppc
->
apfx
[
i
].
x
.
value
,
ppc
->
apfx
[
i
].
y
.
value
);
fixed_to_double
(
ppc
->
apfx
[
i
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
}
break
;
case
TT_PRIM_QSPLINE
:
for
(
i
=
0
;
i
<
ppc
->
cpfx
/
2
;
i
++
)
{
/* FIXME just connecting the control points for now */
TRACE
(
"
\t\t
curve %d,%d %d,%d
\n
"
,
ppc
->
apfx
[
i
*
2
].
x
.
value
,
ppc
->
apfx
[
i
*
3
].
y
.
value
,
ppc
->
apfx
[
i
*
2
+
1
].
x
.
value
,
ppc
->
apfx
[
i
*
3
+
1
].
y
.
value
);
fixed_to_double
(
ppc
->
apfx
[
i
*
2
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
fixed_to_double
(
ppc
->
apfx
[
i
*
2
+
1
],
em_size
,
vertices
);
gluTessVertex
(
tess
,
vertices
,
vertices
);
vertices
+=
3
;
}
break
;
default:
ERR
(
"
\t\t
curve type = %d
\n
"
,
ppc
->
wType
);
gluTessEndContour
(
tess
);
goto
error_in_list
;
}
ppc
=
(
TTPOLYCURVE
*
)((
char
*
)
ppc
+
sizeof
(
*
ppc
)
+
(
ppc
->
cpfx
-
1
)
*
sizeof
(
POINTFX
));
}
gluTessEndContour
(
tess
);
pph
=
(
TTPOLYGONHEADER
*
)((
char
*
)
pph
+
pph
->
cb
);
}
error_in_list:
gluTessEndPolygon
(
tess
);
glEndList
();
LEAVE_GL
();
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
vertices
);
}
error:
DeleteObject
(
SelectObject
(
hdc
,
old_font
));
gluDeleteTess
(
tess
);
return
TRUE
;
}
#else
/* HAVE_GL_GLU_H */
BOOL
WINAPI
wglUseFontOutlines_common
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
,
FLOAT
deviation
,
FLOAT
extrusion
,
int
format
,
LPGLYPHMETRICSFLOAT
lpgmf
,
BOOL
unicode
)
{
FIXME
(
"Unable to compile in wglUseFontOutlines support without GL/glu.h
\n
"
);
return
FALSE
;
}
#endif
/* HAVE_GL_GLU_H */
/***********************************************************************
* wglUseFontOutlinesA (OPENGL32.@)
*/
...
...
@@ -874,10 +1085,24 @@ BOOL WINAPI wglUseFontOutlinesA(HDC hdc,
FLOAT
deviation
,
FLOAT
extrusion
,
int
format
,
LPGLYPHMETRICSFLOAT
lpgmf
)
{
FIXME
(
"(): stub !
\n
"
);
LPGLYPHMETRICSFLOAT
lpgmf
)
{
return
wglUseFontOutlines_common
(
hdc
,
first
,
count
,
listBase
,
deviation
,
extrusion
,
format
,
lpgmf
,
FALSE
);
}
return
FALSE
;
/***********************************************************************
* wglUseFontOutlinesW (OPENGL32.@)
*/
BOOL
WINAPI
wglUseFontOutlinesW
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
,
FLOAT
deviation
,
FLOAT
extrusion
,
int
format
,
LPGLYPHMETRICSFLOAT
lpgmf
)
{
return
wglUseFontOutlines_common
(
hdc
,
first
,
count
,
listBase
,
deviation
,
extrusion
,
format
,
lpgmf
,
TRUE
);
}
const
GLubyte
*
internal_glGetString
(
GLenum
name
)
{
...
...
include/config.h.in
View file @
4eb4546f
...
...
@@ -206,6 +206,9 @@
/* Define to 1 if you have the <GL/glext.h> header file. */
#undef HAVE_GL_GLEXT_H
/* Define to 1 if you have the <GL/glu.h> header file. */
#undef HAVE_GL_GLU_H
/* Define to 1 if you have the <GL/glx.h> header file. */
#undef HAVE_GL_GLX_H
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment