mirror of https://github.com/aap/librw.git
Building null and opengl specific libraries now.
This commit is contained in:
parent
521656dc1e
commit
716a70afae
15
Makefile
15
Makefile
|
@ -1,13 +1,19 @@
|
||||||
|
# null, opengl
|
||||||
|
BUILD=null
|
||||||
|
|
||||||
|
# e.g. null -> -DRW_NULL
|
||||||
|
BUILDDEF:=$(shell echo $(BUILD) | tr a-z A-Z | sed 's/^/-DRW_/')
|
||||||
|
BUILDDIR=build-$(BUILD)
|
||||||
SRCDIR=src
|
SRCDIR=src
|
||||||
BUILDDIR=build
|
|
||||||
SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
|
SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
|
||||||
geometry.cpp plugins.cpp ps2.cpp\
|
geometry.cpp plugins.cpp ps2.cpp\
|
||||||
ogl.cpp)
|
ogl.cpp)
|
||||||
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
|
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
|
||||||
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
|
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
|
||||||
CFLAGS=-Wall -Wextra -g #-Wno-parentheses #-Wconversion
|
CFLAGS=-Wall -Wextra -g $(BUILDDEF) #-Wno-parentheses #-Wconversion
|
||||||
|
LIB=librw-$(BUILD).a
|
||||||
|
|
||||||
librw.a: $(OBJ)
|
$(LIB): $(OBJ)
|
||||||
ar scr $@ $(OBJ)
|
ar scr $@ $(OBJ)
|
||||||
|
|
||||||
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
|
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
|
||||||
|
@ -16,4 +22,7 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
|
||||||
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
|
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
|
||||||
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
|
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(BUILDDIR)/*.[od]
|
||||||
|
|
||||||
-include $(DEP)
|
-include $(DEP)
|
||||||
|
|
15
src/ogl.cpp
15
src/ogl.cpp
|
@ -18,6 +18,17 @@ using namespace std;
|
||||||
namespace Rw {
|
namespace Rw {
|
||||||
namespace Gl {
|
namespace Gl {
|
||||||
|
|
||||||
|
static void
|
||||||
|
printAttribInfo(AttribDesc *attribs, int n)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < n; i++)
|
||||||
|
printf("%x %x %x %x %x %x\n",
|
||||||
|
attribs[i].index,
|
||||||
|
attribs[i].type,
|
||||||
|
attribs[i].normalized,
|
||||||
|
attribs[i].size);
|
||||||
|
}
|
||||||
|
|
||||||
void*
|
void*
|
||||||
DestroyNativeData(void *object, int32, int32)
|
DestroyNativeData(void *object, int32, int32)
|
||||||
{
|
{
|
||||||
|
@ -74,10 +85,10 @@ GetSizeNativeData(void *object, int32, int32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RW_OPENGL
|
||||||
void
|
void
|
||||||
UploadGeo(Geometry *geo)
|
UploadGeo(Geometry *geo)
|
||||||
{
|
{
|
||||||
using namespace Rw;
|
|
||||||
InstanceDataHeader *inst = (InstanceDataHeader*)geo->instData;
|
InstanceDataHeader *inst = (InstanceDataHeader*)geo->instData;
|
||||||
MeshHeader *meshHeader = geo->meshHeader;
|
MeshHeader *meshHeader = geo->meshHeader;
|
||||||
|
|
||||||
|
@ -103,7 +114,6 @@ UploadGeo(Geometry *geo)
|
||||||
void
|
void
|
||||||
SetAttribPointers(InstanceDataHeader *inst)
|
SetAttribPointers(InstanceDataHeader *inst)
|
||||||
{
|
{
|
||||||
using namespace Rw;
|
|
||||||
static GLenum attribType[] = {
|
static GLenum attribType[] = {
|
||||||
GL_FLOAT,
|
GL_FLOAT,
|
||||||
GL_BYTE, GL_UNSIGNED_BYTE,
|
GL_BYTE, GL_UNSIGNED_BYTE,
|
||||||
|
@ -117,6 +127,7 @@ SetAttribPointers(InstanceDataHeader *inst)
|
||||||
(void*)(uint64)a->offset);
|
(void*)(uint64)a->offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue