fixed gl3 renderer

This commit is contained in:
aap 2017-07-27 15:05:30 +02:00
parent 6c5073e864
commit a3d8e3ba01
4 changed files with 17 additions and 14 deletions

View File

@ -22,8 +22,7 @@ is not maintained, it was only a test.
* Get a solid GL3 driver working
* Make building everything a bit easier
# Building
Edit the makefile(s) and type 'make BUILD=gl3'
Get premake5. Generate a config, e.g. with ``premake5 gmake``,
and look in the build directory.

View File

@ -40,6 +40,10 @@ workspace "librw"
system "windows"
filter { "platforms:linux*" }
system "linux"
filter "action:vs*"
buildoptions { "/wd4996" }
filter {}
Libdir = "lib/%{cfg.platform}/%{cfg.buildcfg}"
@ -58,4 +62,4 @@ project "dumprwtree"
files { "tools/dumprwtree/*" }
includedirs { "." }
libdirs { Libdir }
links { "librw" }
links { "librw" }

View File

@ -76,7 +76,7 @@ matfxDefaultRender(InstanceDataHeader *header, InstanceData *inst)
setTexture(0, m->texture);
rw::setRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
flushCache();
glDrawElements(header->primType, inst->numIndex,
@ -175,16 +175,16 @@ matfxEnvRender(InstanceDataHeader *header, InstanceData *inst)
setTexture(0, env->tex);
rw::setRenderState(VERTEXALPHA, 1);
rw::setRenderState(SRCBLEND, BLENDONE);
rw::setRenderState(DESTBLEND, BLENDONE);
rw::SetRenderState(VERTEXALPHA, 1);
rw::SetRenderState(SRCBLEND, BLENDONE);
rw::SetRenderState(DESTBLEND, BLENDONE);
flushCache();
glDrawElements(header->primType, inst->numIndex,
GL_UNSIGNED_SHORT, (void*)(uintptr)inst->offset);
rw::setRenderState(SRCBLEND, BLENDSRCALPHA);
rw::setRenderState(DESTBLEND, BLENDINVSRCALPHA);
rw::SetRenderState(SRCBLEND, BLENDSRCALPHA);
rw::SetRenderState(DESTBLEND, BLENDINVSRCALPHA);
}
void
@ -200,8 +200,8 @@ matfxRenderCB(Atomic *atomic, InstanceDataHeader *header)
InstanceData *inst = header->inst;
int32 n = header->numMeshes;
// rw::setRenderState(ALPHATESTFUNC, 1);
// rw::setRenderState(ALPHATESTREF, 50);
// rw::SetRenderState(ALPHATESTFUNC, 1);
// rw::SetRenderState(ALPHATESTREF, 50);
int32 fx;
while(n--){
@ -483,7 +483,7 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header)
setTexture(0, m->texture);
rw::setRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
flushCache();
glDrawElements(header->primType, inst->numIndex,

View File

@ -103,7 +103,7 @@ defaultRenderCB(Atomic *atomic, InstanceDataHeader *header)
setTexture(0, m->texture);
rw::setRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
flushCache();
glDrawElements(header->primType, inst->numIndex,