Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netrunner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odilitime
netrunner
Commits
30b3f89e
Commit
30b3f89e
authored
7 years ago
by
Odilitime
Browse files
Options
Downloads
Patches
Plain Diff
truncate texture if larger than card supports
parent
b2252443
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphics/text/TextRasterizer.cpp
+11
-1
11 additions, 1 deletion
src/graphics/text/TextRasterizer.cpp
with
11 additions
and
1 deletion
src/graphics/text/TextRasterizer.cpp
+
11
−
1
View file @
30b3f89e
...
...
@@ -154,6 +154,8 @@ std::unique_ptr<std::pair<int, int>> TextRasterizer::size(const rasterizationReq
return
std
::
make_unique
<
std
::
pair
<
int
,
int
>>
(
std
::
pair
<
int
,
int
>
(
response
->
width
,
response
->
height
));
}
#include
<GL/glew.h>
std
::
unique_ptr
<
rasterizationResponse
>
TextRasterizer
::
rasterize
(
const
rasterizationRequest
&
request
)
const
{
if
(
request
.
startX
==
request
.
availableWidth
)
{
...
...
@@ -308,6 +310,14 @@ std::unique_ptr<rasterizationResponse> TextRasterizer::rasterize(const rasteriza
response
->
y1
=
-
response
->
height
;
//std::cout << "xd: " << static_cast<int>(response->x1-response->x0) << " yd: " << static_cast<int>(response->y0-response->y1) << std::endl;
int
max
;
glGetIntegerv
(
GL_MAX_TEXTURE_SIZE
,
&
max
);
std
::
cout
<<
"Requesting texture of "
<<
response
->
textureWidth
<<
"x"
<<
response
->
textureHeight
<<
"max: "
<<
max
<<
std
::
endl
;
if
(
response
->
textureHeight
>
max
)
{
std
::
cout
<<
"Truncating text texture to fit in your video card"
<<
std
::
endl
;
response
->
textureHeight
=
max
;
}
// texture coords
response
->
s0
=
0.0
f
;
response
->
t0
=
0.0
f
;
...
...
@@ -319,7 +329,7 @@ std::unique_ptr<rasterizationResponse> TextRasterizer::rasterize(const rasteriza
// still neds to start at X
cx
=
response
->
wrapped
?
request
.
startX
:
0
;
// reset
cy
=
0
;
//std::cout << "starting at: " << cx << std::endl;
//std::cout << "
[" << request.text << "] wrapped? " << response->wrapped << "
starting at: " << cx << std::endl;
//int miny0 = 99;
int
maxy0
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
glyphCount
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment