Windows fixes

This commit is contained in:
Jack Andersen 2016-04-02 17:30:44 -10:00
parent 165b40448f
commit 01649d42f6
2 changed files with 3 additions and 5 deletions

View File

@ -15,8 +15,8 @@ class ThreadLocalPtr
public: public:
ThreadLocalPtr() {m_key = TlsAlloc();} ThreadLocalPtr() {m_key = TlsAlloc();}
~ThreadLocalPtr() {TlsFree(m_key);} ~ThreadLocalPtr() {TlsFree(m_key);}
T* get() {return static_cast<T*>(TlsGetValue(m_key));} T* get() const {return static_cast<T*>(TlsGetValue(m_key));}
void reset(T* v=nullptr) {TlsSetValue(m_key, v);} void reset(T* v=nullptr) {TlsSetValue(m_key, LPVOID(v));}
#else #else
pthread_key_t m_key; pthread_key_t m_key;
public: public:

View File

@ -320,7 +320,7 @@ GLDataFactory::Context::newStaticArrayTexture(size_t width, size_t height, size_
class GLShaderPipeline : public IShaderPipeline class GLShaderPipeline : public IShaderPipeline
{ {
friend class GLDataFactory; friend class GLDataFactory;
friend class GLCommandQueue; friend struct GLCommandQueue;
friend struct GLShaderDataBinding; friend struct GLShaderDataBinding;
GLuint m_vert = 0; GLuint m_vert = 0;
GLuint m_frag = 0; GLuint m_frag = 0;
@ -992,12 +992,10 @@ struct GLCommandQueue : IGraphicsCommandQueue
glClearColor(cmd.rgba[0], cmd.rgba[1], cmd.rgba[2], cmd.rgba[3]); glClearColor(cmd.rgba[0], cmd.rgba[1], cmd.rgba[2], cmd.rgba[3]);
break; break;
case Command::Op::ClearTarget: case Command::Op::ClearTarget:
{
if (cmd.flags & GL_DEPTH_BUFFER_BIT) if (cmd.flags & GL_DEPTH_BUFFER_BIT)
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glClear(cmd.flags); glClear(cmd.flags);
break; break;
}
case Command::Op::Draw: case Command::Op::Draw:
glDrawArrays(currentPrim, cmd.start, cmd.count); glDrawArrays(currentPrim, cmd.start, cmd.count);
break; break;