Remove trailing whitespace.

TRAC #11024 Signed-off-by: Daniel Koch Author: Andrew Lewycky <andrew.lewycky@transgaming.com> git-svn-id: https://angleproject.googlecode.com/svn/trunk@11 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 1697302a
...@@ -74,7 +74,7 @@ class Config ...@@ -74,7 +74,7 @@ class Config
class SortConfig class SortConfig
{ {
public: public:
explicit SortConfig(const EGLint *attribList); explicit SortConfig(const EGLint *attribList);
bool operator()(const Config *x, const Config *y) const; bool operator()(const Config *x, const Config *y) const;
bool operator()(const Config &x, const Config &y) const; bool operator()(const Config &x, const Config &y) const;
......
...@@ -139,7 +139,7 @@ struct State ...@@ -139,7 +139,7 @@ struct State
bool colorMaskBlue; bool colorMaskBlue;
bool colorMaskAlpha; bool colorMaskAlpha;
bool depthMask; bool depthMask;
int activeSampler; // Active texture unit selector - GL_TEXTURE0 int activeSampler; // Active texture unit selector - GL_TEXTURE0
GLuint arrayBuffer; GLuint arrayBuffer;
GLuint elementArrayBuffer; GLuint elementArrayBuffer;
......
...@@ -114,7 +114,7 @@ bool Display::initialize() ...@@ -114,7 +114,7 @@ bool Display::initialize()
if (SUCCEEDED(result)) if (SUCCEEDED(result))
{ {
HRESULT result = mD3d9->CheckDepthStencilMatch(mAdapter, mDeviceType, currentDisplayMode.Format, renderTargetFormat, depthStencilFormat); // FIXME: Only accept color formats available both in fullscreen and windowed? HRESULT result = mD3d9->CheckDepthStencilMatch(mAdapter, mDeviceType, currentDisplayMode.Format, renderTargetFormat, depthStencilFormat); // FIXME: Only accept color formats available both in fullscreen and windowed?
if (SUCCEEDED(result)) if (SUCCEEDED(result))
{ {
// FIXME: Enumerate multi-sampling // FIXME: Enumerate multi-sampling
...@@ -273,7 +273,7 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config) ...@@ -273,7 +273,7 @@ egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config)
swapChain->Release(); swapChain->Release();
} }
return surface; return surface;
} }
......
...@@ -99,12 +99,12 @@ void Surface::swap() ...@@ -99,12 +99,12 @@ void Surface::swap()
} }
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
IDirect3DSurface9 *textureSurface; IDirect3DSurface9 *textureSurface;
texture->GetSurfaceLevel(0, &textureSurface); texture->GetSurfaceLevel(0, &textureSurface);
device->StretchRect(mRenderTarget, NULL, textureSurface, NULL, D3DTEXF_POINT); device->StretchRect(mRenderTarget, NULL, textureSurface, NULL, D3DTEXF_POINT);
// Disable all pipeline operations // Disable all pipeline operations
device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
...@@ -145,7 +145,7 @@ void Surface::swap() ...@@ -145,7 +145,7 @@ void Surface::swap()
{ {
return error(EGL_BAD_ALLOC); return error(EGL_BAD_ALLOC);
} }
textureSurface->Release(); textureSurface->Release();
texture->Release(); texture->Release();
device->Release(); device->Release();
......
...@@ -39,43 +39,43 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) ...@@ -39,43 +39,43 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
// Fall throught to initialize index // Fall throught to initialize index
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
{ {
egl::Current *current = (egl::Current*)LocalAlloc(LPTR, sizeof(egl::Current)); egl::Current *current = (egl::Current*)LocalAlloc(LPTR, sizeof(egl::Current));
if (current) if (current)
{ {
TlsSetValue(currentTLS, current); TlsSetValue(currentTLS, current);
current->error = EGL_SUCCESS; current->error = EGL_SUCCESS;
current->API = EGL_OPENGL_ES_API; current->API = EGL_OPENGL_ES_API;
} }
} }
break; break;
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
{ {
void *current = TlsGetValue(currentTLS); void *current = TlsGetValue(currentTLS);
if (current) if (current)
{ {
LocalFree((HLOCAL)current); LocalFree((HLOCAL)current);
} }
} }
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
{ {
void *current = TlsGetValue(currentTLS); void *current = TlsGetValue(currentTLS);
if (current) if (current)
{ {
LocalFree((HLOCAL)current); LocalFree((HLOCAL)current);
} }
TlsFree(currentTLS); TlsFree(currentTLS);
} }
break; break;
default: default:
break; break;
} }
return TRUE; return TRUE;
} }
......
...@@ -27,7 +27,7 @@ class Buffer ...@@ -27,7 +27,7 @@ class Buffer
~Buffer(); ~Buffer();
void storeData(GLsizeiptr size, const void *data); void storeData(GLsizeiptr size, const void *data);
IDirect3DVertexBuffer9 *getVertexBuffer(); IDirect3DVertexBuffer9 *getVertexBuffer();
IDirect3DIndexBuffer9 *getIndexBuffer(); IDirect3DIndexBuffer9 *getIndexBuffer();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// Context.cpp: Implements the gl::Context class, managing all GL state and performing // Context.cpp: Implements the gl::Context class, managing all GL state and performing
// rendering operations. It is the GLES2 specific implementation of EGLContext. // rendering operations. It is the GLES2 specific implementation of EGLContext.
#include "Context.h" #include "Context.h"
#include <algorithm> #include <algorithm>
...@@ -537,7 +537,7 @@ void Context::setRenderbuffer(Renderbuffer *buffer) ...@@ -537,7 +537,7 @@ void Context::setRenderbuffer(Renderbuffer *buffer)
Buffer *Context::getBuffer(unsigned int handle) Buffer *Context::getBuffer(unsigned int handle)
{ {
BufferMap::iterator buffer = mBufferMap.find(handle); BufferMap::iterator buffer = mBufferMap.find(handle);
if (buffer == mBufferMap.end()) if (buffer == mBufferMap.end())
{ {
return NULL; return NULL;
...@@ -551,7 +551,7 @@ Buffer *Context::getBuffer(unsigned int handle) ...@@ -551,7 +551,7 @@ Buffer *Context::getBuffer(unsigned int handle)
Shader *Context::getShader(unsigned int handle) Shader *Context::getShader(unsigned int handle)
{ {
ShaderMap::iterator shader = mShaderMap.find(handle); ShaderMap::iterator shader = mShaderMap.find(handle);
if (shader == mShaderMap.end()) if (shader == mShaderMap.end())
{ {
return NULL; return NULL;
...@@ -565,7 +565,7 @@ Shader *Context::getShader(unsigned int handle) ...@@ -565,7 +565,7 @@ Shader *Context::getShader(unsigned int handle)
Program *Context::getProgram(unsigned int handle) Program *Context::getProgram(unsigned int handle)
{ {
ProgramMap::iterator program = mProgramMap.find(handle); ProgramMap::iterator program = mProgramMap.find(handle);
if (program == mProgramMap.end()) if (program == mProgramMap.end())
{ {
return NULL; return NULL;
...@@ -579,7 +579,7 @@ Program *Context::getProgram(unsigned int handle) ...@@ -579,7 +579,7 @@ Program *Context::getProgram(unsigned int handle)
Texture *Context::getTexture(unsigned int handle) Texture *Context::getTexture(unsigned int handle)
{ {
TextureMap::iterator texture = mTextureMap.find(handle); TextureMap::iterator texture = mTextureMap.find(handle);
if (texture == mTextureMap.end()) if (texture == mTextureMap.end())
{ {
return NULL; return NULL;
...@@ -593,7 +593,7 @@ Texture *Context::getTexture(unsigned int handle) ...@@ -593,7 +593,7 @@ Texture *Context::getTexture(unsigned int handle)
Framebuffer *Context::getFramebuffer(unsigned int handle) Framebuffer *Context::getFramebuffer(unsigned int handle)
{ {
FramebufferMap::iterator framebuffer = mFramebufferMap.find(handle); FramebufferMap::iterator framebuffer = mFramebufferMap.find(handle);
if (framebuffer == mFramebufferMap.end()) if (framebuffer == mFramebufferMap.end())
{ {
return NULL; return NULL;
...@@ -607,7 +607,7 @@ Framebuffer *Context::getFramebuffer(unsigned int handle) ...@@ -607,7 +607,7 @@ Framebuffer *Context::getFramebuffer(unsigned int handle)
Renderbuffer *Context::getRenderbuffer(unsigned int handle) Renderbuffer *Context::getRenderbuffer(unsigned int handle)
{ {
RenderbufferMap::iterator renderbuffer = mRenderbufferMap.find(handle); RenderbufferMap::iterator renderbuffer = mRenderbufferMap.find(handle);
if (renderbuffer == mRenderbufferMap.end()) if (renderbuffer == mRenderbufferMap.end())
{ {
return NULL; return NULL;
...@@ -929,7 +929,7 @@ void Context::applyVertexBuffer(int count) ...@@ -929,7 +929,7 @@ void Context::applyVertexBuffer(int count)
{ {
if (vertexAttribute[attributeIndex].enabled && programObject->isActiveAttribute(attributeIndex)) if (vertexAttribute[attributeIndex].enabled && programObject->isActiveAttribute(attributeIndex))
{ {
GLuint boundBuffer = vertexAttribute[attributeIndex].boundBuffer; GLuint boundBuffer = vertexAttribute[attributeIndex].boundBuffer;
UINT stride = vertexAttribute[attributeIndex].stride; UINT stride = vertexAttribute[attributeIndex].stride;
GLint size = vertexAttribute[attributeIndex].size; GLint size = vertexAttribute[attributeIndex].size;
GLenum type = vertexAttribute[attributeIndex].type; GLenum type = vertexAttribute[attributeIndex].type;
...@@ -1402,7 +1402,7 @@ void Context::clear(GLbitfield mask) ...@@ -1402,7 +1402,7 @@ void Context::clear(GLbitfield mask)
const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) && const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) &&
(stencilWritemask & stencilUnmasked) != stencilUnmasked; (stencilWritemask & stencilUnmasked) != stencilUnmasked;
const bool needMaskedColorClear = (flags & D3DCLEAR_TARGET) && const bool needMaskedColorClear = (flags & D3DCLEAR_TARGET) &&
!(colorMaskRed && colorMaskGreen && !(colorMaskRed && colorMaskGreen &&
colorMaskBlue && alphaUnmasked); colorMaskBlue && alphaUnmasked);
if (needMaskedColorClear || needMaskedStencilClear) if (needMaskedColorClear || needMaskedStencilClear)
...@@ -1435,7 +1435,7 @@ void Context::clear(GLbitfield mask) ...@@ -1435,7 +1435,7 @@ void Context::clear(GLbitfield mask)
device->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS); device->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS);
device->SetRenderState(D3DRS_STENCILREF, stencil); device->SetRenderState(D3DRS_STENCILREF, stencil);
device->SetRenderState(D3DRS_STENCILWRITEMASK, stencilWritemask); device->SetRenderState(D3DRS_STENCILWRITEMASK, stencilWritemask);
device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE); device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
device->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE); device->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE);
device->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE); device->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE);
} }
...@@ -1448,7 +1448,7 @@ void Context::clear(GLbitfield mask) ...@@ -1448,7 +1448,7 @@ void Context::clear(GLbitfield mask)
device->SetVertexShader(NULL); device->SetVertexShader(NULL);
device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE); device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
struct Vertex struct Vertex
{ {
float x, y, z, w; float x, y, z, w;
D3DCOLOR diffuse; D3DCOLOR diffuse;
......
...@@ -82,7 +82,7 @@ void Framebuffer::detachRenderbuffer(GLuint renderbuffer) ...@@ -82,7 +82,7 @@ void Framebuffer::detachRenderbuffer(GLuint renderbuffer)
IDirect3DSurface9 *Framebuffer::getRenderTarget() IDirect3DSurface9 *Framebuffer::getRenderTarget()
{ {
Renderbuffer *colorbuffer = getColorbuffer(); Renderbuffer *colorbuffer = getColorbuffer();
if (colorbuffer) if (colorbuffer)
{ {
return colorbuffer->getRenderTarget(); return colorbuffer->getRenderTarget();
...@@ -95,7 +95,7 @@ IDirect3DSurface9 *Framebuffer::getDepthStencil() ...@@ -95,7 +95,7 @@ IDirect3DSurface9 *Framebuffer::getDepthStencil()
{ {
gl::Context *context = gl::getContext(); gl::Context *context = gl::getContext();
Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle); Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle);
if (depthbuffer) if (depthbuffer)
{ {
return depthbuffer->getDepthStencil(); return depthbuffer->getDepthStencil();
...@@ -131,7 +131,7 @@ Depthbuffer *Framebuffer::getDepthbuffer() ...@@ -131,7 +131,7 @@ Depthbuffer *Framebuffer::getDepthbuffer()
{ {
gl::Context *context = gl::getContext(); gl::Context *context = gl::getContext();
Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle); Depthbuffer *depthbuffer = context->getDepthbuffer(mDepthbufferHandle);
if (depthbuffer && depthbuffer->isDepthbuffer()) if (depthbuffer && depthbuffer->isDepthbuffer())
{ {
return depthbuffer; return depthbuffer;
...@@ -144,7 +144,7 @@ Stencilbuffer *Framebuffer::getStencilbuffer() ...@@ -144,7 +144,7 @@ Stencilbuffer *Framebuffer::getStencilbuffer()
{ {
gl::Context *context = gl::getContext(); gl::Context *context = gl::getContext();
Stencilbuffer *stencilbuffer = context->getStencilbuffer(mStencilbufferHandle); Stencilbuffer *stencilbuffer = context->getStencilbuffer(mStencilbufferHandle);
if (stencilbuffer && stencilbuffer->isStencilbuffer()) if (stencilbuffer && stencilbuffer->isStencilbuffer())
{ {
return stencilbuffer; return stencilbuffer;
......
...@@ -419,7 +419,7 @@ void Program::link() ...@@ -419,7 +419,7 @@ void Program::link()
} }
ASSERT(SUCCEEDED(vertexResult) && SUCCEEDED(pixelResult)); ASSERT(SUCCEEDED(vertexResult) && SUCCEEDED(pixelResult));
vertexBinary->Release(); vertexBinary->Release();
pixelBinary->Release(); pixelBinary->Release();
vertexBinary = NULL; vertexBinary = NULL;
...@@ -435,14 +435,14 @@ void Program::link() ...@@ -435,14 +435,14 @@ void Program::link()
D3DXCONSTANTTABLE_DESC constantTableDescription; D3DXCONSTANTTABLE_DESC constantTableDescription;
D3DXCONSTANT_DESC constantDescription; D3DXCONSTANT_DESC constantDescription;
UINT descriptionCount = 1; UINT descriptionCount = 1;
mConstantTablePS->GetDesc(&constantTableDescription); mConstantTablePS->GetDesc(&constantTableDescription);
for (unsigned int constantIndex = 0; constantIndex < constantTableDescription.Constants; constantIndex++) for (unsigned int constantIndex = 0; constantIndex < constantTableDescription.Constants; constantIndex++)
{ {
D3DXHANDLE constantHandle = mConstantTablePS->GetConstant(0, constantIndex); D3DXHANDLE constantHandle = mConstantTablePS->GetConstant(0, constantIndex);
mConstantTablePS->GetConstantDesc(constantHandle, &constantDescription, &descriptionCount); mConstantTablePS->GetConstantDesc(constantHandle, &constantDescription, &descriptionCount);
UniformArray::iterator uniform = mUniforms.begin(); UniformArray::iterator uniform = mUniforms.begin();
while (uniform != mUniforms.end()) while (uniform != mUniforms.end())
...@@ -831,7 +831,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v) ...@@ -831,7 +831,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
for (unsigned int samplerIndex = firstIndex; samplerIndex < firstIndex + count; samplerIndex++) for (unsigned int samplerIndex = firstIndex; samplerIndex < firstIndex + count; samplerIndex++)
{ {
GLint mappedSampler = v[0]; GLint mappedSampler = v[0];
if (mappedSampler >= 0 && mappedSampler < MAX_TEXTURE_IMAGE_UNITS) if (mappedSampler >= 0 && mappedSampler < MAX_TEXTURE_IMAGE_UNITS)
{ {
if (samplerIndex >= 0 && samplerIndex < MAX_TEXTURE_IMAGE_UNITS) if (samplerIndex >= 0 && samplerIndex < MAX_TEXTURE_IMAGE_UNITS)
...@@ -840,7 +840,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v) ...@@ -840,7 +840,7 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
} }
} }
} }
return true; return true;
} }
} }
......
...@@ -81,7 +81,7 @@ class Program ...@@ -81,7 +81,7 @@ class Program
bool setUniform1iv(GLint location, GLsizei count, const GLint *v); bool setUniform1iv(GLint location, GLsizei count, const GLint *v);
void applyUniforms(); void applyUniforms();
void link(); void link();
bool isLinked(); bool isLinked();
......
...@@ -235,7 +235,7 @@ const char *VertexShader::linkHLSL(const char *pixelHLSL) ...@@ -235,7 +235,7 @@ const char *VertexShader::linkHLSL(const char *pixelHLSL)
char varyingName[100]; char varyingName[100];
int semanticIndex; int semanticIndex;
int matches = sscanf(input, "%s : TEXCOORD%d;", varyingName, &semanticIndex); int matches = sscanf(input, "%s : TEXCOORD%d;", varyingName, &semanticIndex);
if (matches == 2) if (matches == 2)
{ {
ASSERT(semanticIndex < 10 && semanticIndex < MAX_VARYING_VECTORS); ASSERT(semanticIndex < 10 && semanticIndex < MAX_VARYING_VECTORS);
......
...@@ -45,7 +45,7 @@ bool Texture::setMinFilter(GLenum filter) ...@@ -45,7 +45,7 @@ bool Texture::setMinFilter(GLenum filter)
return true; return true;
default: default:
return false; return false;
} }
} }
// Returns true on successful filter state update (valid enum parameter) // Returns true on successful filter state update (valid enum parameter)
...@@ -442,7 +442,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget() ...@@ -442,7 +442,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget()
{ {
if (!mRenderTarget && getTexture()) if (!mRenderTarget && getTexture())
{ {
mTexture->GetSurfaceLevel(0, &mRenderTarget); mTexture->GetSurfaceLevel(0, &mRenderTarget);
} }
return mRenderTarget; return mRenderTarget;
......
...@@ -23,7 +23,7 @@ enum ...@@ -23,7 +23,7 @@ enum
{ {
MAX_TEXTURE_SIZE = 2048, MAX_TEXTURE_SIZE = 2048,
MAX_CUBE_MAP_TEXTURE_SIZE = 2048, MAX_CUBE_MAP_TEXTURE_SIZE = 2048,
MAX_TEXTURE_LEVELS = 11 // log2 of MAX_TEXTURE_SIZE MAX_TEXTURE_LEVELS = 11 // log2 of MAX_TEXTURE_SIZE
}; };
......
...@@ -62,7 +62,7 @@ void __stdcall glAttachShader(GLuint program, GLuint shader) ...@@ -62,7 +62,7 @@ void __stdcall glAttachShader(GLuint program, GLuint shader)
{ {
gl::Program *programObject = context->getProgram(program); gl::Program *programObject = context->getProgram(program);
gl::Shader *shaderObject = context->getShader(shader); gl::Shader *shaderObject = context->getShader(shader);
if (!programObject || !shaderObject) if (!programObject || !shaderObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -96,7 +96,7 @@ void __stdcall glBindAttribLocation(GLuint program, GLuint index, const char* na ...@@ -96,7 +96,7 @@ void __stdcall glBindAttribLocation(GLuint program, GLuint index, const char* na
if (context) if (context)
{ {
gl::Program *programObject = context->getProgram(program); gl::Program *programObject = context->getProgram(program);
if (!programObject) if (!programObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -436,7 +436,7 @@ void __stdcall glBufferData(GLenum target, GLsizeiptr size, const void* data, GL ...@@ -436,7 +436,7 @@ void __stdcall glBufferData(GLenum target, GLsizeiptr size, const void* data, GL
if (context) if (context)
{ {
gl::Buffer *buffer; gl::Buffer *buffer;
switch (target) switch (target)
{ {
case GL_ARRAY_BUFFER: case GL_ARRAY_BUFFER:
...@@ -619,7 +619,7 @@ void __stdcall glCompileShader(GLuint shader) ...@@ -619,7 +619,7 @@ void __stdcall glCompileShader(GLuint shader)
if (context) if (context)
{ {
gl::Shader *shaderObject = context->getShader(shader); gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject) if (!shaderObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -696,7 +696,7 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma ...@@ -696,7 +696,7 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
{ {
TRACE("GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d", TRACE("GLenum target = 0x%X, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
target, level, xoffset, yoffset, x, y, width, height); target, level, xoffset, yoffset, x, y, width, height);
try try
...@@ -748,7 +748,7 @@ GLuint __stdcall glCreateShader(GLenum type) ...@@ -748,7 +748,7 @@ GLuint __stdcall glCreateShader(GLenum type)
switch (type) switch (type)
{ {
case GL_FRAGMENT_SHADER: case GL_FRAGMENT_SHADER:
case GL_VERTEX_SHADER: case GL_VERTEX_SHADER:
return context->createShader(type); return context->createShader(type);
default: default:
return error(GL_INVALID_ENUM, 0); return error(GL_INVALID_ENUM, 0);
...@@ -1030,7 +1030,7 @@ void __stdcall glDetachShader(GLuint program, GLuint shader) ...@@ -1030,7 +1030,7 @@ void __stdcall glDetachShader(GLuint program, GLuint shader)
{ {
gl::Program *programObject = context->getProgram(program); gl::Program *programObject = context->getProgram(program);
gl::Shader *shaderObject = context->getShader(shader); gl::Shader *shaderObject = context->getShader(shader);
if (!programObject || !shaderObject) if (!programObject || !shaderObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -1906,7 +1906,7 @@ void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params) ...@@ -1906,7 +1906,7 @@ void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
if (context) if (context)
{ {
gl::Shader *shaderObject = context->getShader(shader); gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject) if (!shaderObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -2603,7 +2603,7 @@ void __stdcall glSampleCoverage(GLclampf value, GLboolean invert) ...@@ -2603,7 +2603,7 @@ void __stdcall glSampleCoverage(GLclampf value, GLboolean invert)
try try
{ {
gl::Context* context = gl::getContext(); gl::Context* context = gl::getContext();
if (context) if (context)
{ {
context->sampleCoverageValue = gl::clamp01(value); context->sampleCoverageValue = gl::clamp01(value);
...@@ -2628,7 +2628,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -2628,7 +2628,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
} }
gl::Context* context = gl::getContext(); gl::Context* context = gl::getContext();
if (context) if (context)
{ {
context->scissorX = x; context->scissorX = x;
...@@ -2645,7 +2645,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height) ...@@ -2645,7 +2645,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
void __stdcall glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) void __stdcall glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
{ {
TRACE("GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, const void* binary = 0x%0.8p, GLsizei length = %d", TRACE("GLsizei n = %d, const GLuint* shaders = 0x%0.8p, GLenum binaryformat = 0x%X, const void* binary = 0x%0.8p, GLsizei length = %d",
n, shaders, binaryformat, binary, length); n, shaders, binaryformat, binary, length);
try try
...@@ -2679,7 +2679,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string, ...@@ -2679,7 +2679,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string,
if (context) if (context)
{ {
gl::Shader *shaderObject = context->getShader(shader); gl::Shader *shaderObject = context->getShader(shader);
if (!shaderObject) if (!shaderObject)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
...@@ -2696,7 +2696,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string, ...@@ -2696,7 +2696,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const char** string,
void __stdcall glStencilFunc(GLenum func, GLint ref, GLuint mask) void __stdcall glStencilFunc(GLenum func, GLint ref, GLuint mask)
{ {
glStencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask); glStencilFuncSeparate(GL_FRONT_AND_BACK, func, ref, mask);
} }
void __stdcall glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) void __stdcall glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
...@@ -2827,7 +2827,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu ...@@ -2827,7 +2827,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR: case GL_DECR:
case GL_INVERT: case GL_INVERT:
case GL_INCR_WRAP: case GL_INCR_WRAP:
case GL_DECR_WRAP: case GL_DECR_WRAP:
break; break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
...@@ -2842,7 +2842,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu ...@@ -2842,7 +2842,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR: case GL_DECR:
case GL_INVERT: case GL_INVERT:
case GL_INCR_WRAP: case GL_INCR_WRAP:
case GL_DECR_WRAP: case GL_DECR_WRAP:
break; break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
...@@ -2857,7 +2857,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu ...@@ -2857,7 +2857,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
case GL_DECR: case GL_DECR:
case GL_INVERT: case GL_INVERT:
case GL_INCR_WRAP: case GL_INCR_WRAP:
case GL_DECR_WRAP: case GL_DECR_WRAP:
break; break;
default: default:
return error(GL_INVALID_ENUM); return error(GL_INVALID_ENUM);
...@@ -2903,7 +2903,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL ...@@ -2903,7 +2903,7 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
} }
switch (target) switch (target)
{ {
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
......
...@@ -28,10 +28,10 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) ...@@ -28,10 +28,10 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
} }
} }
// Fall throught to initialize index // Fall throught to initialize index
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
{ {
gl::Current *current = (gl::Current*)LocalAlloc(LPTR, sizeof(gl::Current)); gl::Current *current = (gl::Current*)LocalAlloc(LPTR, sizeof(gl::Current));
if (current) if (current)
{ {
TlsSetValue(currentTLS, current); TlsSetValue(currentTLS, current);
...@@ -40,17 +40,17 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) ...@@ -40,17 +40,17 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
current->display = NULL; current->display = NULL;
} }
} }
break; break;
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
{ {
void *current = TlsGetValue(currentTLS); void *current = TlsGetValue(currentTLS);
if (current) if (current)
{ {
LocalFree((HLOCAL)current); LocalFree((HLOCAL)current);
} }
} }
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
{ {
void *current = TlsGetValue(currentTLS); void *current = TlsGetValue(currentTLS);
...@@ -59,14 +59,14 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) ...@@ -59,14 +59,14 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{ {
LocalFree((HLOCAL)current); LocalFree((HLOCAL)current);
} }
TlsFree(currentTLS); TlsFree(currentTLS);
} }
break; break;
default: default:
break; break;
} }
return TRUE; return TRUE;
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
namespace es2dx namespace es2dx
{ {
D3DCMPFUNC ConvertComparison(GLenum comparison) D3DCMPFUNC ConvertComparison(GLenum comparison)
{ {
D3DCMPFUNC d3dComp = D3DCMP_ALWAYS; D3DCMPFUNC d3dComp = D3DCMP_ALWAYS;
switch (comparison) switch (comparison)
...@@ -188,7 +188,7 @@ void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DT ...@@ -188,7 +188,7 @@ void ConvertMinFilter(GLenum minFilter, D3DTEXTUREFILTERTYPE *d3dMinFilter, D3DT
*d3dMinFilter = D3DTEXF_LINEAR; *d3dMinFilter = D3DTEXF_LINEAR;
*d3dMipFilter = D3DTEXF_LINEAR; *d3dMipFilter = D3DTEXF_LINEAR;
break; break;
default: default:
*d3dMinFilter = D3DTEXF_POINT; *d3dMinFilter = D3DTEXF_POINT;
*d3dMipFilter = D3DTEXF_NONE; *d3dMipFilter = D3DTEXF_NONE;
UNREACHABLE(); UNREACHABLE();
...@@ -223,7 +223,7 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat) ...@@ -223,7 +223,7 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat)
{ {
switch (colorFormat) switch (colorFormat)
{ {
case D3DFMT_A2R10G10B10: case D3DFMT_A2R10G10B10:
return 2; return 2;
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
return 8; return 8;
...@@ -242,7 +242,7 @@ unsigned int GetRedSize(D3DFORMAT colorFormat) ...@@ -242,7 +242,7 @@ unsigned int GetRedSize(D3DFORMAT colorFormat)
{ {
switch (colorFormat) switch (colorFormat)
{ {
case D3DFMT_A2R10G10B10: case D3DFMT_A2R10G10B10:
return 10; return 10;
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8: case D3DFMT_X8R8G8B8:
...@@ -260,7 +260,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat) ...@@ -260,7 +260,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat)
{ {
switch (colorFormat) switch (colorFormat)
{ {
case D3DFMT_A2R10G10B10: case D3DFMT_A2R10G10B10:
return 10; return 10;
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8: case D3DFMT_X8R8G8B8:
...@@ -279,7 +279,7 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat) ...@@ -279,7 +279,7 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat)
{ {
switch (colorFormat) switch (colorFormat)
{ {
case D3DFMT_A2R10G10B10: case D3DFMT_A2R10G10B10:
return 10; return 10;
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8: case D3DFMT_X8R8G8B8:
...@@ -314,7 +314,7 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat) ...@@ -314,7 +314,7 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat)
return 0; return 0;
} }
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount, bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount) D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount)
{ {
switch (primitiveType) switch (primitiveType)
......
...@@ -37,7 +37,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat); ...@@ -37,7 +37,7 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat);
unsigned int GetBlueSize(D3DFORMAT colorFormat); unsigned int GetBlueSize(D3DFORMAT colorFormat);
unsigned int GetDepthSize(D3DFORMAT depthFormat); unsigned int GetDepthSize(D3DFORMAT depthFormat);
unsigned int GetStencilSize(D3DFORMAT stencilFormat); unsigned int GetStencilSize(D3DFORMAT stencilFormat);
bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount, bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount,
D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount); D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment