Fix nimterop version

This commit is contained in:
Joey Yakimowich-Payne 2020-08-23 17:17:26 -06:00
commit 6ed15c4290
8 changed files with 84 additions and 80 deletions

View file

@ -8,7 +8,7 @@ srcDir = "src"
skipDirs = @["build"] skipDirs = @["build"]
# Dependencies # Dependencies
requires "nim >= 1.0.6", "nimterop#head", "regex >= 0.14.1" requires "nim >= 1.0.6", "https://github.com/jyapayne/nimterop#367ec05", "regex >= 0.14.1"
when gorgeEx("nimble path nimterop").exitCode == 0: when gorgeEx("nimble path nimterop").exitCode == 0:
import nimterop/docs import nimterop/docs

View file

@ -1,5 +1,5 @@
import os, strutils, strformat import os, strutils, strformat
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
SDLCacheDir* = getProjectCacheDir("nimsdl2") SDLCacheDir* = getProjectCacheDir("nimsdl2")

View file

@ -1,6 +1,6 @@
import os, strutils, strformat import os, strutils, strformat
import sdl2 import sdl2
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir

View file

@ -1,6 +1,6 @@
import os, strformat, strutils import os, strformat, strutils
import sdl2 import sdl2
import nimterop/[build, cimport] import nimterop/[build, cimport, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir
@ -26,14 +26,20 @@ static:
# cDisableCaching() # cDisableCaching()
cOverride: cOverride:
type
WindowFlagEnum* = WindowFlags
LogLevelEnum* = enum
LOG_LEVEL_INFO = 0
LOG_LEVEL_WARNING
LOG_LEVEL_ERROR
const const
RENDERER_UNKNOWN* = 0.uint32
RENDERER_OPENGL_1_BASE* = 1.uint32
RENDERER_OPENGL_1* = 2.uint32
RENDERER_OPENGL_2* = 3.uint32
RENDERER_OPENGL_3* = 4.uint32
RENDERER_OPENGL_4* = 5.uint32
RENDERER_GLES_1* = 11.uint32
RENDERER_GLES_2* = 12.uint32
RENDERER_GLES_3* = 13.uint32
RENDERER_D3D9* = 21.uint32
RENDERER_D3D10* = 22.uint32
RENDERER_D3D11* = 23.uint32
NONE* = 0.uint32 NONE* = 0.uint32
FEATURE_NON_POWER_OF_TWO* = 0x1.uint32 FEATURE_NON_POWER_OF_TWO* = 0x1.uint32
FEATURE_RENDER_TARGETS* = 0x2.uint32 FEATURE_RENDER_TARGETS* = 0x2.uint32
@ -49,12 +55,6 @@ const
FEATURE_GEOMETRY_SHADER* = 0x400.uint32 FEATURE_GEOMETRY_SHADER* = 0x400.uint32
FEATURE_WRAP_REPEAT_MIRRORED* = 0x800.uint32 FEATURE_WRAP_REPEAT_MIRRORED* = 0x800.uint32
FEATURE_CORE_FRAMEBUFFER_OBJECTS* = 0x1000.uint32 FEATURE_CORE_FRAMEBUFFER_OBJECTS* = 0x1000.uint32
FEATURE_ALL_BASE* = FEATURE_RENDER_TARGETS
FEATURE_ALL_BLEND_PRESETS* = (FEATURE_BLEND_EQUATIONS or FEATURE_BLEND_FUNC_SEPARATE)
FEATURE_ALL_GL_FORMATS* = (FEATURE_GL_BGR or FEATURE_GL_BGRA or FEATURE_GL_ABGR)
FEATURE_BASIC_SHADERS* = (FEATURE_FRAGMENT_SHADER or FEATURE_VERTEX_SHADER)
FEATURE_ALL_SHADERS* = (FEATURE_FRAGMENT_SHADER or FEATURE_VERTEX_SHADER or FEATURE_GEOMETRY_SHADER)
INIT_ENABLE_VSYNC* = 0x1.uint32 INIT_ENABLE_VSYNC* = 0x1.uint32
INIT_DISABLE_VSYNC* = 0x2.uint32 INIT_DISABLE_VSYNC* = 0x2.uint32
INIT_DISABLE_DOUBLE_BUFFER* = 0x4.uint32 INIT_DISABLE_DOUBLE_BUFFER* = 0x4.uint32
@ -78,6 +78,42 @@ const
BATCH_RGBA* = 0x10.uint32 BATCH_RGBA* = 0x10.uint32
BATCH_RGB8* = 0x20.uint32 BATCH_RGB8* = 0x20.uint32
BATCH_RGBA8* = 0x40.uint32 BATCH_RGBA8* = 0x40.uint32
FLIP_NONE* = 0x0.uint32
FLIP_HORIZONTAL* = 0x1.uint32
FLIP_VERTICAL* = 0x2.uint32
TYPE_BYTE* = 0x1400.uint32
TYPE_UNSIGNED_BYTE* = 0x1401.uint32
TYPE_SHORT* = 0x1402.uint32
TYPE_UNSIGNED_SHORT* = 0x1403.uint32
TYPE_INT* = 0x1404.uint32
TYPE_UNSIGNED_INT* = 0x1405.uint32
TYPE_FLOAT* = 0x1406.uint32
TYPE_DOUBLE* = 0x140A.uint32
type
WindowFlagEnum* = WindowFlags
LogLevelEnum* = enum
LOG_LEVEL_INFO = 0
LOG_LEVEL_WARNING
LOG_LEVEL_ERROR
cPluginPath(symbolPluginPath)
when defined(SDL_gpu_Static):
cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2 -H")
else:
cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, dynlib = "SDL_gpuLPath", flags = &"-I={SDLIncludeDir} -f=ast2 -H")
let
FEATURE_FRAGMENT_SHADER* = 0x200.uint32
FEATURE_ALL_BLEND_PRESETS* = (FEATURE_BLEND_EQUATIONS or FEATURE_BLEND_FUNC_SEPARATE)
FEATURE_ALL_GL_FORMATS* = (FEATURE_GL_BGR or FEATURE_GL_BGRA or FEATURE_GL_ABGR)
FEATURE_BASIC_SHADERS* = (FEATURE_FRAGMENT_SHADER or FEATURE_VERTEX_SHADER)
FEATURE_ALL_SHADERS* = (FEATURE_FRAGMENT_SHADER or FEATURE_VERTEX_SHADER or FEATURE_GEOMETRY_SHADER)
BATCH_XY_ST* = (BATCH_XY or BATCH_ST) BATCH_XY_ST* = (BATCH_XY or BATCH_ST)
BATCH_XYZ_ST* = (BATCH_XYZ or BATCH_ST) BATCH_XYZ_ST* = (BATCH_XYZ or BATCH_ST)
@ -94,35 +130,3 @@ const
BATCH_XY_ST_RGBA8* = (BATCH_XY or BATCH_ST or BATCH_RGBA8) BATCH_XY_ST_RGBA8* = (BATCH_XY or BATCH_ST or BATCH_RGBA8)
BATCH_XYZ_ST_RGBA8* = (BATCH_XYZ or BATCH_ST or BATCH_RGBA8) BATCH_XYZ_ST_RGBA8* = (BATCH_XYZ or BATCH_ST or BATCH_RGBA8)
FLIP_NONE* = 0x0.uint32
FLIP_HORIZONTAL* = 0x1.uint32
FLIP_VERTICAL* = 0x2.uint32
TYPE_BYTE* = 0x1400.uint32
TYPE_UNSIGNED_BYTE* = 0x1401.uint32
TYPE_SHORT* = 0x1402.uint32
TYPE_UNSIGNED_SHORT* = 0x1403.uint32
TYPE_INT* = 0x1404.uint32
TYPE_UNSIGNED_INT* = 0x1405.uint32
TYPE_FLOAT* = 0x1406.uint32
TYPE_DOUBLE* = 0x140A.uint32
RENDERER_UNKNOWN* = 0.uint32
RENDERER_OPENGL_1_BASE* = 1.uint32
RENDERER_OPENGL_1* = 2.uint32
RENDERER_OPENGL_2* = 3.uint32
RENDERER_OPENGL_3* = 4.uint32
RENDERER_OPENGL_4* = 5.uint32
RENDERER_GLES_1* = 11.uint32
RENDERER_GLES_2* = 12.uint32
RENDERER_GLES_3* = 13.uint32
RENDERER_D3D9* = 21.uint32
RENDERER_D3D10* = 22.uint32
RENDERER_D3D11* = 23.uint32
cPluginPath(symbolPluginPath)
when defined(SDL_gpu_Static):
cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2 -H")
else:
cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, dynlib = "SDL_gpuLPath", flags = &"-I={SDLIncludeDir} -f=ast2 -H")

View file

@ -1,6 +1,6 @@
import os, strutils, strformat import os, strutils, strformat
import sdl2 import sdl2
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir

View file

@ -1,6 +1,6 @@
import os, strutils, strformat import os, strutils, strformat
import sdl2 import sdl2
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir

View file

@ -1,6 +1,6 @@
import os, strutils, strformat import os, strutils, strformat
import sdl2 import sdl2
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir

View file

@ -1,6 +1,6 @@
import os, strutils, strformat import os, strutils, strformat
import sdl2 import sdl2
import nimterop/[cimport, build] import nimterop/[cimport, build, globals]
const const
baseDir = SDLCacheDir baseDir = SDLCacheDir