Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
1dda3b18
Commit
1dda3b18
authored
Dec 16, 2011
by
daniel@transgaming.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ConvertTextureFormatType
Trac #19259 Issue=268 Signed-off-by: Nicolas Capens git-svn-id:
https://angleproject.googlecode.com/svn/trunk@917
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
38f28cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
44 deletions
+44
-44
Texture.cpp
src/libGLESv2/Texture.cpp
+44
-44
No files found.
src/libGLESv2/Texture.cpp
View file @
1dda3b18
...
@@ -29,6 +29,50 @@ namespace gl
...
@@ -29,6 +29,50 @@ namespace gl
{
{
unsigned
int
TextureStorage
::
mCurrentTextureSerial
=
1
;
unsigned
int
TextureStorage
::
mCurrentTextureSerial
=
1
;
static
D3DFORMAT
ConvertTextureFormatType
(
GLenum
format
,
GLenum
type
)
{
if
(
format
==
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
||
format
==
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
)
{
return
D3DFMT_DXT1
;
}
else
if
(
format
==
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
)
{
return
D3DFMT_DXT3
;
}
else
if
(
format
==
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
)
{
return
D3DFMT_DXT5
;
}
else
if
(
type
==
GL_FLOAT
)
{
return
D3DFMT_A32B32G32R32F
;
}
else
if
(
type
==
GL_HALF_FLOAT_OES
)
{
return
D3DFMT_A16B16G16R16F
;
}
else
if
(
type
==
GL_UNSIGNED_BYTE
)
{
if
(
format
==
GL_LUMINANCE
&&
getContext
()
->
supportsLuminanceTextures
())
{
return
D3DFMT_L8
;
}
else
if
(
format
==
GL_LUMINANCE_ALPHA
&&
getContext
()
->
supportsLuminanceAlphaTextures
())
{
return
D3DFMT_A8L8
;
}
else
if
(
format
==
GL_RGB
)
{
return
D3DFMT_X8R8G8B8
;
}
return
D3DFMT_A8R8G8B8
;
}
return
D3DFMT_A8R8G8B8
;
}
Image
::
Image
()
Image
::
Image
()
{
{
mWidth
=
0
;
mWidth
=
0
;
...
@@ -176,50 +220,6 @@ bool Image::isRenderable() const
...
@@ -176,50 +220,6 @@ bool Image::isRenderable() const
return
false
;
return
false
;
}
}
static
D3DFORMAT
ConvertTextureFormatType
(
GLenum
format
,
GLenum
type
)
{
if
(
format
==
GL_COMPRESSED_RGB_S3TC_DXT1_EXT
||
format
==
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
)
{
return
D3DFMT_DXT1
;
}
else
if
(
format
==
GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE
)
{
return
D3DFMT_DXT3
;
}
else
if
(
format
==
GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE
)
{
return
D3DFMT_DXT5
;
}
else
if
(
type
==
GL_FLOAT
)
{
return
D3DFMT_A32B32G32R32F
;
}
else
if
(
type
==
GL_HALF_FLOAT_OES
)
{
return
D3DFMT_A16B16G16R16F
;
}
else
if
(
type
==
GL_UNSIGNED_BYTE
)
{
if
(
format
==
GL_LUMINANCE
&&
getContext
()
->
supportsLuminanceTextures
())
{
return
D3DFMT_L8
;
}
else
if
(
format
==
GL_LUMINANCE_ALPHA
&&
getContext
()
->
supportsLuminanceAlphaTextures
())
{
return
D3DFMT_A8L8
;
}
else
if
(
format
==
GL_RGB
)
{
return
D3DFMT_X8R8G8B8
;
}
return
D3DFMT_A8R8G8B8
;
}
return
D3DFMT_A8R8G8B8
;
}
D3DFORMAT
Image
::
getD3DFormat
()
const
D3DFORMAT
Image
::
getD3DFormat
()
const
{
{
return
ConvertTextureFormatType
(
mFormat
,
mType
);
return
ConvertTextureFormatType
(
mFormat
,
mType
);
...
...
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