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
b945bfd3
Commit
b945bfd3
authored
Jan 06, 2004
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jan 06, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement wglUseFontBitmapsW.
parent
5bf3a266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
69 deletions
+104
-69
make_opengl
dlls/opengl32/make_opengl
+1
-1
opengl32.spec
dlls/opengl32/opengl32.spec
+1
-1
wgl.c
dlls/opengl32/wgl.c
+102
-67
No files found.
dlls/opengl32/make_opengl
View file @
b945bfd3
...
...
@@ -557,7 +557,7 @@ print SPEC "@ stdcall wglCreateContext(long)
@ stdcall wglUseFontOutlinesA(long long long long long long long ptr)
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ st
ub wglUseFontBitmapsW
@ st
dcall wglUseFontBitmapsW(long long long long)
@ stub wglUseFontOutlinesW
@ stub wglGetDefaultProcAddress
@ stdcall wglChoosePixelFormat(long ptr) gdi32.ChoosePixelFormat
...
...
dlls/opengl32/opengl32.spec
View file @
b945bfd3
...
...
@@ -18,7 +18,7 @@
@ stdcall wglUseFontOutlinesA(long long long long long long long ptr)
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ st
ub wglUseFontBitmapsW
@ st
dcall wglUseFontBitmapsW(long long long long)
@ stub wglUseFontOutlinesW
@ stub wglGetDefaultProcAddress
@ stdcall wglChoosePixelFormat(long ptr) gdi32.ChoosePixelFormat
...
...
dlls/opengl32/wgl.c
View file @
b945bfd3
...
...
@@ -480,19 +480,12 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
return
TRUE
;
}
/***********************************************************************
* wglUseFontBitmapsA (OPENGL32.@)
*/
BOOL
WINAPI
wglUseFontBitmapsA
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
)
static
BOOL
internal_wglUseFontBitmaps
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
,
DWORD
WINAPI
(
*
GetGlyphOutline_ptr
)(
HDC
,
UINT
,
UINT
,
LPGLYPHMETRICS
,
DWORD
,
LPVOID
,
const
MAT2
*
))
{
Font
fid
=
get_font
(
hdc
);
TRACE
(
"(%p, %ld, %ld, %ld) using font %ld
\n
"
,
hdc
,
first
,
count
,
listBase
,
fid
);
if
(
fid
==
0
)
{
/* We are running using client-side rendering fonts... */
GLYPHMETRICS
gm
;
static
const
MAT2
id
=
{
{
0
,
1
},
{
0
,
0
},
{
0
,
0
},
{
0
,
0
}
};
...
...
@@ -507,67 +500,68 @@ BOOL WINAPI wglUseFontBitmapsA(HDC hdc,
LEAVE_GL
();
for
(
glyph
=
first
;
glyph
<
first
+
count
;
glyph
++
)
{
int
needed_size
=
GetGlyphOutlineA
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
0
,
NULL
,
&
id
);
int
height
,
width_int
;
if
(
needed_size
==
GDI_ERROR
)
goto
error
;
if
(
needed_size
>
size
)
{
size
=
needed_size
;
if
(
bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
);
if
(
gl_bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
gl_bitmap
);
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
gl_bitmap
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
if
(
GetGlyphOutlineA
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
size
,
bitmap
,
&
id
)
==
GDI_ERROR
)
goto
error
;
if
(
TRACE_ON
(
opengl
))
{
unsigned
int
height
,
width
,
bitmask
;
unsigned
char
*
bitmap_
=
(
unsigned
char
*
)
bitmap
;
DPRINTF
(
"Glyph : %d
\n
"
,
glyph
);
DPRINTF
(
" - bbox : %d x %d
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
DPRINTF
(
" - origin : (%ld , %ld)
\n
"
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmptGlyphOrigin
.
y
);
DPRINTF
(
" - increment : %d - %d
\n
"
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
);
DPRINTF
(
" - size : %d
\n
"
,
needed_size
);
DPRINTF
(
" - bitmap :
\n
"
);
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
DPRINTF
(
" "
);
for
(
width
=
0
,
bitmask
=
0x80
;
width
<
gm
.
gmBlackBoxX
;
width
++
,
bitmask
>>=
1
)
{
if
(
bitmask
==
0
)
{
bitmap_
+=
1
;
bitmask
=
0x80
;
int
needed_size
=
GetGlyphOutline_ptr
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
0
,
NULL
,
&
id
);
int
height
,
width_int
;
if
(
needed_size
==
GDI_ERROR
)
goto
error
;
if
(
needed_size
>
size
)
{
size
=
needed_size
;
if
(
bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
);
if
(
gl_bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
gl_bitmap
);
bitmap
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
gl_bitmap
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
if
(
GetGlyphOutline_ptr
(
hdc
,
glyph
,
GGO_BITMAP
,
&
gm
,
size
,
bitmap
,
&
id
)
==
GDI_ERROR
)
goto
error
;
if
(
TRACE_ON
(
opengl
))
{
unsigned
int
height
,
width
,
bitmask
;
unsigned
char
*
bitmap_
=
(
unsigned
char
*
)
bitmap
;
DPRINTF
(
"Glyph : %d
\n
"
,
glyph
);
DPRINTF
(
" - bbox : %d x %d
\n
"
,
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
);
DPRINTF
(
" - origin : (%ld , %ld)
\n
"
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmptGlyphOrigin
.
y
);
DPRINTF
(
" - increment : %d - %d
\n
"
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
);
DPRINTF
(
" - size : %d
\n
"
,
needed_size
);
DPRINTF
(
" - bitmap :
\n
"
);
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
DPRINTF
(
" "
);
for
(
width
=
0
,
bitmask
=
0x80
;
width
<
gm
.
gmBlackBoxX
;
width
++
,
bitmask
>>=
1
)
{
if
(
bitmask
==
0
)
{
bitmap_
+=
1
;
bitmask
=
0x80
;
}
if
(
*
bitmap_
&
bitmask
)
DPRINTF
(
"*"
);
else
DPRINTF
(
" "
);
}
bitmap_
+=
(
4
-
(((
unsigned
int
)
bitmap_
)
&
0x03
));
DPRINTF
(
"
\n
"
);
}
if
(
*
bitmap_
&
bitmask
)
DPRINTF
(
"*"
);
else
DPRINTF
(
" "
);
}
bitmap_
+=
(
4
-
(((
unsigned
int
)
bitmap_
)
&
0x03
));
DPRINTF
(
"
\n
"
);
}
}
/* For some obscure reasons, I seem to need to rotate the glyph for OpenGL to be happy.
As Wine does not seem to support the MAT2 field, I need to do it myself.... */
width_int
=
(
gm
.
gmBlackBoxX
+
31
)
/
32
;
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
int
width
;
for
(
width
=
0
;
width
<
width_int
;
width
++
)
{
((
int
*
)
gl_bitmap
)[(
gm
.
gmBlackBoxY
-
height
-
1
)
*
width_int
+
width
]
=
((
int
*
)
bitmap
)[
height
*
width_int
+
width
];
/* For some obscure reasons, I seem to need to rotate the glyph for OpenGL to be happy.
As Wine does not seem to support the MAT2 field, I need to do it myself.... */
width_int
=
(
gm
.
gmBlackBoxX
+
31
)
/
32
;
for
(
height
=
0
;
height
<
gm
.
gmBlackBoxY
;
height
++
)
{
int
width
;
for
(
width
=
0
;
width
<
width_int
;
width
++
)
{
((
int
*
)
gl_bitmap
)[(
gm
.
gmBlackBoxY
-
height
-
1
)
*
width_int
+
width
]
=
((
int
*
)
bitmap
)[
height
*
width_int
+
width
];
}
}
}
ENTER_GL
(
);
glNewList
(
listBase
++
,
GL_COMPILE
);
glBitmap
(
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmBlackBoxY
-
gm
.
gmptGlyphOrigin
.
y
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
,
gl_bitmap
);
glEndList
();
LEAVE_GL
();
ENTER_GL
();
glNewList
(
listBase
++
,
GL_COMPILE
);
glBitmap
(
gm
.
gmBlackBoxX
,
gm
.
gmBlackBoxY
,
gm
.
gmptGlyphOrigin
.
x
,
gm
.
gmBlackBoxY
-
gm
.
gmptGlyphOrigin
.
y
,
gm
.
gmCellIncX
,
gm
.
gmCellIncY
,
gl_bitmap
);
glEndList
();
LEAVE_GL
();
}
ENTER_GL
();
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
org_alignment
);
LEAVE_GL
();
if
(
bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
);
if
(
gl_bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
gl_bitmap
);
return
TRUE
;
...
...
@@ -579,9 +573,50 @@ BOOL WINAPI wglUseFontBitmapsA(HDC hdc,
if
(
bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
bitmap
);
if
(
gl_bitmap
)
HeapFree
(
GetProcessHeap
(),
0
,
gl_bitmap
);
return
FALSE
;
return
FALSE
;
}
/***********************************************************************
* wglUseFontBitmapsA (OPENGL32.@)
*/
BOOL
WINAPI
wglUseFontBitmapsA
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
)
{
Font
fid
=
get_font
(
hdc
);
TRACE
(
"(%p, %ld, %ld, %ld) using font %ld
\n
"
,
hdc
,
first
,
count
,
listBase
,
fid
);
if
(
fid
==
0
)
{
return
internal_wglUseFontBitmaps
(
hdc
,
first
,
count
,
listBase
,
GetGlyphOutlineA
);
}
ENTER_GL
();
/* I assume that the glyphs are at the same position for X and for Windows */
glXUseXFont
(
fid
,
first
,
count
,
listBase
);
LEAVE_GL
();
return
TRUE
;
}
/***********************************************************************
* wglUseFontBitmapsW (OPENGL32.@)
*/
BOOL
WINAPI
wglUseFontBitmapsW
(
HDC
hdc
,
DWORD
first
,
DWORD
count
,
DWORD
listBase
)
{
Font
fid
=
get_font
(
hdc
);
TRACE
(
"(%p, %ld, %ld, %ld) using font %ld
\n
"
,
hdc
,
first
,
count
,
listBase
,
fid
);
if
(
fid
==
0
)
{
return
internal_wglUseFontBitmaps
(
hdc
,
first
,
count
,
listBase
,
GetGlyphOutlineW
);
}
WARN
(
"Using the glX API for the WCHAR variant - some characters may come out incorrectly !
\n
"
);
ENTER_GL
();
/* I assume that the glyphs are at the same position for X and for Windows */
glXUseXFont
(
fid
,
first
,
count
,
listBase
);
...
...
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