diff --git a/motorcar-compositor.pro b/motorcar-compositor.pro index 5064c9c..0890693 100644 --- a/motorcar-compositor.pro +++ b/motorcar-compositor.pro @@ -21,6 +21,11 @@ TEMPLATE = lib MOTORCAR_PROTOCOL_PATH=$$PWD/src/protocol/ system(cd $$MOTORCAR_PROTOCOL_PATH; make) + +libmotorcarclient.commands = echo "testing123" && cd src/client && make -f Makefile + +QMAKE_EXTRA_TARGETS += libmotorcarclient + INCLUDEPATH += $$MOTORCAR_PROTOCOL_PATH #LIBS += -L $$MOTORCAR_PROTOCOL_PATH -lmotorcar-server HEADERS += $$MOTORCAR_PROTOCOL_PATH/motorcar-server-protocol.h @@ -48,6 +53,7 @@ INCLUDEPATH += $$QTWAYLANDSOURCEPATH/include #RESOURCES += motorcar-compositor.qrc target.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/motorcar-compositor +target.depends = libmotorcarclient sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS motorcar-compositor.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtwayland/motorcar-compositor INSTALLS += target sources diff --git a/src/client/ClientApplication.cpp b/src/client/ClientApplication.cpp new file mode 100644 index 0000000..768ff4d --- /dev/null +++ b/src/client/ClientApplication.cpp @@ -0,0 +1,21 @@ +/* + * ClientApplication.cpp + * + * Created on: Aug 3, 2014 + * Author: dave + */ + +#include "ClientApplication.h" + +namespace motorcar { + +ClientApplication::ClientApplication() { + + +} + +ClientApplication::~ClientApplication() { + // TODO Auto-generated destructor stub +} + +} /* namespace motorcar */ diff --git a/src/client/ClientApplication.h b/src/client/ClientApplication.h new file mode 100644 index 0000000..ba3e87f --- /dev/null +++ b/src/client/ClientApplication.h @@ -0,0 +1,64 @@ +/* + * ClientApplication.h + * + * Created on: Aug 3, 2014 + * Author: dave + */ + +#ifndef CLIENTAPPLICATION_H_ +#define CLIENTAPPLICATION_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include +#include +#include +#include "motorcar-client-protocol.h" + +//#include +#include + +#include +#include + +#include +#include +#include +#include "glm/gtc/matrix_access.hpp" + +#include +#include + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 +#define EGL_BUFFER_AGE_EXT 0x313D +#endif + +namespace motorcar { + +class ClientApplication { +public: + ClientApplication(); + virtual ~ClientApplication(); + + +}; + +} /* namespace motorcar */ + +#endif /* CLIENTAPPLICATION_H_ */ diff --git a/src/client/Makefile b/src/client/Makefile new file mode 100644 index 0000000..0c9a628 --- /dev/null +++ b/src/client/Makefile @@ -0,0 +1,20 @@ +MOTORCAR_PROTOCOL_XML=../protocol/motorcar.xml +LIBS= -lm -lwayland-client -lwayland-egl -lwayland-cursor -DGL_GLEXT_PROTOTYPES -lGL -lEGL + +CC=g++ +OBJECTS=ClientApplication.o motorcar-wayland-extensions.o +CFLAGS=-fPIC -Wall -Werror + +motorcar-client: ${OBJECTS} + ${CC} ${CFLAGS} -shared -Wl,-soname,libmotorcar-client.so -o libmotorcar-client.so ${OBJECTS} + +ClientApplication.o: ClientApplication.cpp ClientApplication.h motorcar-wayland-extensions + ${CC} ${CFLAGS} -c ClientApplication.cpp + +motorcar-wayland-extensions: + wayland-scanner client-header < $(MOTORCAR_PROTOCOL_XML) > motorcar-client-protocol.h + wayland-scanner code < $(MOTORCAR_PROTOCOL_XML) > motorcar-wayland-extensions.c + gcc -c -Wall -Werror -fpic motorcar-wayland-extensions.c + +clean: + rm -rf *.o *.so motorcar-wayland-extensions.c motorcar-client-protocol.h \ No newline at end of file diff --git a/src/device/ovrvisionsensor.cpp b/src/device/ovrvisionsensor.cpp new file mode 100644 index 0000000..8807bfd --- /dev/null +++ b/src/device/ovrvisionsensor.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** +**This file is part of the Motorcar 3D windowing framework +** +** +**Copyright (C) 2014 Forrest Reiling +** +** +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** +****************************************************************************/ + +#include "ovrvisionsensor.h" + +using namespace motorcar; + +OVRVisionSensor::OVRVisionSensor(SceneGraphNode *parent, const glm::mat4 &transform) + :Drawable(parent, transform) +{ + printf("constructed OVRVisionSensor\n"); +} + +void OVRVisionSensor::draw(Scene *scene, Display *display){ + +} \ No newline at end of file diff --git a/src/device/ovrvisionsensor.h b/src/device/ovrvisionsensor.h new file mode 100644 index 0000000..ec4745d --- /dev/null +++ b/src/device/ovrvisionsensor.h @@ -0,0 +1,53 @@ +/**************************************************************************** +**This file is part of the Motorcar 3D windowing framework +** +** +**Copyright (C) 2014 Forrest Reiling +** +** +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** +****************************************************************************/ + +#ifndef OVRVISION_H +#define OVRVISION_H + +#include + +namespace motorcar { + +class OVRVisionSensor : public Drawable +{ +public: + OVRVisionSensor(SceneGraphNode *parent, const glm::mat4 &transform = glm::mat4()); + void draw(Scene *scene, Display *display) override; + +}; + +} + +#endif \ No newline at end of file diff --git a/src/examples/compositors/rift-hydra-compositor/Makefile b/src/examples/compositors/rift-hydra-compositor/Makefile index d8242d0..780619e 100644 --- a/src/examples/compositors/rift-hydra-compositor/Makefile +++ b/src/examples/compositors/rift-hydra-compositor/Makefile @@ -14,7 +14,7 @@ SIXENSE_LIBS= -L${SIXENSEPATH}/lib/linux_x64/release -lsixense_utils_x64 -lsixen INCLUDES= -I${MOTORCAR_DIR}/src/compositor -I${MOTORCAR_DIR}/src/protocol -I${MOTORCAR_DIR}/src/device ${OCULUS_INCLUDES} ${SIXENSE_INCLUDES} LIBS= -L${MOTORCAR_DIR}/lib -lmotorcar-compositor -ludev -lpthread -lGL -lX11 -lXinerama CFLAGS=-std=c++11 -objects=oculushmd.o sixensemotionsensingsystem.o sixensecontrollernode.o sixensebasenode.o +objects=oculushmd.o sixensemotionsensingsystem.o sixensecontrollernode.o sixensebasenode.o ovrvisionsensor.o compositor: main.cpp sixense $(objects) ${CC} main.cpp $(objects) ${CFLAGS} ${INCLUDES} ${OCULUS_LIBS} ${SIXENSE_LIBS} ${LIBS} -o rift-hydra-compositor @@ -33,6 +33,11 @@ SIXENSE_SOURCES=${MOTORCAR_DIR}/src/device/sixensemotionsensingsystem.cpp \ sixense: ${SIXENSE_HEADERS} ${SIXENSE_SOURCES} ${CC} -c ${SIXENSE_SOURCES} ${CFLAGS} ${INCLUDES} ${SIXENSE_LIBS} ${LIBS} +ovrvisionsensor.o: ${MOTORCAR_DIR}/src/device/ovrvisionsensor.cpp ${MOTORCAR_DIR}/src/device/ovrvisionsensor.h + ${CC} -c ${MOTORCAR_DIR}/src/device/ovrvisionsensor.cpp ${CFLAGS} ${INCLUDES} ${LIBS} + + + clean: rm rift-hydra-compositor $(objects) \ No newline at end of file diff --git a/src/examples/compositors/rift-hydra-compositor/main.cpp b/src/examples/compositors/rift-hydra-compositor/main.cpp index 8e1560a..b549cc2 100644 --- a/src/examples/compositors/rift-hydra-compositor/main.cpp +++ b/src/examples/compositors/rift-hydra-compositor/main.cpp @@ -41,6 +41,7 @@ #include #include #include +#include int main(int argc, char *argv[]) @@ -117,6 +118,7 @@ int main(int argc, char *argv[]) // compositor->display()->setTransform(glm::translate(glm::mat4(1), glm::vec3(0,-0.25, 0))); } + motorcar::OVRVisionSensor *ovrVision = new motorcar::OVRVisionSensor(compositor->display());