Skip to content

Commit

Permalink
fix tests with tinygles
Browse files Browse the repository at this point in the history
  • Loading branch information
lunixbochs committed Mar 21, 2018
1 parent e3d5b6b commit 60b1e47
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/tinygles/context.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "zgl.h"

GLContext *gl_ctx = NULL;

GLContext *gl_get_context() {
return gl_ctx;
}
1 change: 0 additions & 1 deletion src/tinygles/glx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Bool tglXQueryExtension(Display *dpy, int *errorb, int *event) {
return True;
}


XVisualInfo* tglXChooseVisual(Display *dpy, int screen, int *attribList) {
XVisualInfo vinfo;
int n;
Expand Down
2 changes: 0 additions & 2 deletions src/tinygles/init.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "zgl.h"

GLContext *gl_ctx;

void initSharedState(GLContext *c) {
GLSharedState *s = &c->shared_state;
s->texture_hash_table = calloc(1, sizeof(GLTexture *) * TEXTURE_HASH_TABLE_SIZE);
Expand Down
2 changes: 2 additions & 0 deletions src/util/extypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ typedef int32_t GLfixed;

// glx + x11

#ifndef GLX_H
typedef void *DMbuffer;
typedef void *GLXContextID;
typedef int GLXDrawable;
Expand Down Expand Up @@ -95,6 +96,7 @@ struct __GLXFBConfigRec {
double minAlpha, maxAlpha;
};
typedef struct __GLXFBConfigRec *GLXFBConfig;
#endif // GLX_H

// egl
#if !defined(__unix__) && defined(__APPLE__) && defined(__MACH__)
Expand Down
11 changes: 7 additions & 4 deletions test/util/template/CMakeLists.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8.12)

project(test)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY {{ bin_dir }})
Expand All @@ -9,10 +9,12 @@ include_directories({{ project }}/src)
include_directories({{ project }}/src/gl)
include_directories({{ project }}/src/util)

add_definitions(-include test.h -include test_skip.h)
include({{ project }}/flags.cmake)

file(GLOB_RECURSE GL_SOURCES {{ project }}/src/gl/*.c {{ project }}/src/gl/*.cpp {{ project }}/src/tinygles/*.c)
file(GLOB_RECURSE TGL_SOURCES {{ project }}/src/tinygles/*.c)
add_library(tgl STATIC ${TGL_SOURCES})

file(GLOB_RECURSE GL_SOURCES {{ project }}/src/gl/*.c {{ project }}/src/gl/*.cpp)
file(GLOB UTIL_SOURCES {{ project }}/src/util/*.c {{ project }}/src/util/math/*.c)
set(GL_SOURCES ${GL_SOURCES} ${UTIL_SOURCES})

Expand All @@ -21,7 +23,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()

add_executable(tmp ${GL_SOURCES} {{ sources }} {{ util }}/mock.c)
target_link_libraries(tmp X11 m dl pthread)
target_compile_options(tmp PRIVATE "-include{{ util }}/test.h" "-include{{ util }}/test_skip.h")
target_link_libraries(tmp X11 m dl pthread tgl)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(tmp rt)
endif()
2 changes: 1 addition & 1 deletion test/util/template/CMakeLists_pure.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()

add_executable(tmp ${GL_SOURCES} {{ sources }})
target_link_libraries(tmp X11 m dl pthread)
target_link_libraries(tmp X11 Xext m dl pthread)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(tmp rt)
endif()

0 comments on commit 60b1e47

Please sign in to comment.