Use static libs for sdl2
This commit is contained in:
parent
a04d332538
commit
9aa5277476
6 changed files with 18 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import nanovg
|
||||
import glfw, opengl
|
||||
import glfw, glew
|
||||
import perf
|
||||
import common
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import sdl2/sdl2 as sdl
|
||||
import sdl2/sdl2_image as img, opengl
|
||||
import sdl2/sdl2_image as img, glew
|
||||
|
||||
import os
|
||||
import nanovg
|
||||
|
|
@ -72,10 +72,10 @@ proc main() =
|
|||
|
||||
glewInit()
|
||||
let vg = nanovg.newContext()
|
||||
vg.loadFont(currentSourceDir()/"resources/Roboto-Regular.ttf", "sans")
|
||||
vg.loadFont(currentSourceDir()/"resources/Roboto-Bold.ttf", "sans-bold")
|
||||
vg.loadFont(currentSourceDir()/"resources/fa.ttf", "fa")
|
||||
vg.loadFont(currentSourceDir()/"resources/entypo.ttf", "icons")
|
||||
vg.loadFont(currentSourceDir()/"resources"/"Roboto-Regular.ttf", "sans")
|
||||
vg.loadFont(currentSourceDir()/"resources"/"Roboto-Bold.ttf", "sans-bold")
|
||||
vg.loadFont(currentSourceDir()/"resources"/"fa.ttf", "fa")
|
||||
vg.loadFont(currentSourceDir()/"resources"/"entypo.ttf", "icons")
|
||||
|
||||
while not done:
|
||||
let fbSize = window.frameBufferSize()
|
||||
|
|
@ -87,7 +87,7 @@ proc main() =
|
|||
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT or GL_STENCIL_BUFFER_BIT)
|
||||
|
||||
vg.withFrame(window):
|
||||
let x = glyphPositions(vg, "Some仮名thing is up", 0, 0)
|
||||
vg.text("Some仮名thing is up", 100, 100, 100)
|
||||
vg.drawWindow("Title", 50, 50, 300, 400)
|
||||
vg.drawLabel("Hello!", 10, 10, 280, 20)
|
||||
vg.drawButton(ICON_TRASH, "Delete", 100, 200, 160, 28, rgba(128, 16, 8, 255))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import sdl2/sdl2 as sdl
|
||||
import sdl2/sdl2_gpu as gpu
|
||||
import opengl
|
||||
import glew
|
||||
|
||||
import os
|
||||
import nanovg
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ requires "nim >= 1.0.6",
|
|||
"regex >= 0.14.1",
|
||||
"opengl >= 1.2.6",
|
||||
"nim-glfw#head",
|
||||
"nim_sdl2"
|
||||
"nim_sdl2",
|
||||
"glew"
|
||||
|
||||
import os
|
||||
|
||||
|
|
|
|||
2
nim.cfg
2
nim.cfg
|
|
@ -1,7 +1,7 @@
|
|||
@if useGlfw:
|
||||
-d:glfwStaticLib
|
||||
@end
|
||||
-d:useGlew
|
||||
-d:GLEW_SetVer="2.1.0" -d:glewDL -d:glewStatic
|
||||
-d:nanovg_Git
|
||||
-d:nanovg_setver="1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4"
|
||||
-d:nanovg_Static
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import opengl
|
||||
import strutils
|
||||
import glew
|
||||
|
||||
import nimterop/[cimport, build]
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ src/*.h
|
|||
src/*.c
|
||||
""", checkout = "1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4")
|
||||
|
||||
let contents = readFile(srcDir/"src/nanovg_gl.h")
|
||||
let contents = readFile(srcDir/"src"/"nanovg_gl.h")
|
||||
when defined(useGlfw):
|
||||
let newContents = contents.replace("#define NANOVG_GL_H", """
|
||||
#define NANOVG_GL_H
|
||||
|
|
@ -79,9 +79,9 @@ when defined(macosx):
|
|||
else:
|
||||
{.passC: "-DNANOVG_GL3_IMPLEMENTATION -DNANOVG_GLEW".}
|
||||
when defined(nanovg_Static):
|
||||
{.passL: "-m64 -lglew -framework GLUT -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -framework Carbon -framework CoreAudio -lm".}
|
||||
{.passL: "-m64 -framework GLUT -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -framework Carbon -framework CoreAudio -lm".}
|
||||
else:
|
||||
{.passL: "-m64 -lSDL2 -framework GLUT -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -framework Carbon -framework CoreAudio -lm".}
|
||||
{.passL: "-m64 -lSDL2 -lglew -framework GLUT -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -framework Carbon -framework CoreAudio -lm".}
|
||||
|
||||
elif defined(unix):
|
||||
{.passC: "-DNANOVG_GL3_IMPLEMENTATION -DNANOVG_GLEW".}
|
||||
|
|
@ -134,6 +134,6 @@ cPlugin:
|
|||
|
||||
# Finally import wrapped header file. Recurse if #include files should also
|
||||
# be wrapped. Set dynlib if binding to dynamic library.
|
||||
cImport(srcDir/"src/nanovg.h", flags = "-f=ast2")
|
||||
cImport(srcDir/"src/nanovg_gl.h", flags = "-f=ast2")
|
||||
cImport(srcDir/"src/nanovg_gl_utils.h", flags = "-f=ast2")
|
||||
cImport(srcDir/"src"/"nanovg.h", flags = "-f=ast2")
|
||||
cImport(srcDir/"src"/"nanovg_gl.h", flags = "-f=ast2")
|
||||
cImport(srcDir/"src"/"nanovg_gl_utils.h", flags = "-f=ast2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue