Fix bug with new nimterop

This commit is contained in:
Joey Yakimowich-Payne 2020-08-12 20:29:27 -06:00
commit f246054ac6
2 changed files with 6 additions and 1 deletions

View file

@ -22,6 +22,8 @@ const underscoreReg = re"_(.)"
# Symbol renaming examples # Symbol renaming examples
proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} = proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} =
if sym.name.startsWith("__"):
sym.name = sym.name[2..<sym.name.len]
if sym.name.startsWith("GL_BYTE"): if sym.name.startsWith("GL_BYTE"):
sym.name = "CGL_BYTE" sym.name = "CGL_BYTE"
if sym.name.startsWith("GL_SHORT"): if sym.name.startsWith("GL_SHORT"):
@ -56,3 +58,6 @@ proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} =
sym.name = sym.name.replace(underscoreReg, camelCase) sym.name = sym.name.replace(underscoreReg, camelCase)
if sym.name == "type": if sym.name == "type":
sym.name = "kind" sym.name = "kind"
if sym.name.startsWith("GetTransformFeedbacki_v"):
sym.name = sym.name & "u"

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
ProjectCacheDir* = getProjectCacheDir("nimglew") ProjectCacheDir* = getProjectCacheDir("nimglew")