Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
374428e3
Commit
374428e3
authored
Jul 14, 1995
by
Ken Martin
Browse files
fixed size checking
parent
9928e82c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OglrText.cc
View file @
374428e3
...
...
@@ -52,6 +52,7 @@ void vtkOglrTexture::Load(vtkTexture *txt, vtkOglrRenderer *ren)
int
rowLength
;
unsigned
char
*
resultData
;
int
xsize
,
ysize
;
unsigned
short
xs
,
ys
;
// get some info
size
=
txt
->
GetInput
()
->
GetDimensions
();
...
...
@@ -101,10 +102,20 @@ void vtkOglrTexture::Load(vtkTexture *txt, vtkOglrRenderer *ren)
}
}
// xsize and ysize must be a multiple of 2 in OpenGL
if
(
xsize
%
2
||
ysize
%
2
)
// xsize and ysize must be a power of 2 in OpenGL
xs
=
(
unsigned
short
)
xsize
;
ys
=
(
unsigned
short
)
ysize
;
while
(
!
(
xs
&
0x01
))
{
vtkWarningMacro
(
<<
"Texture maps must have an even width and height in OpenGL
\n
"
);
xs
=
xs
>>
1
;
}
while
(
!
(
ys
&
0x01
))
{
ys
=
ys
>>
1
;
}
if
((
xs
>
1
)
||
(
ys
>
1
))
{
vtkWarningMacro
(
<<
"Texture map's width and height must be a power of two in OpenGL
\n
"
);
}
// format the data so that it can be sent to the gl
...
...
Write
Preview
Supports
Markdown
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