对capi.dll进行了修改,以使得opengl可以跳转回脚本,请自行下载glut32测试,目前已成功进行初始化- @echo on
- set capi=API Call kernel32 GetModuleHandleW $capi.dll
- if not "%capi_ret%"=="" goto next
- echo 正在进行opengl初始化...
- capi
- set capi=mem alloc 4
- set var1=%capi_ret%
- set capi=mem put ;%var1% ;1
- set capi=mem alloc 4
- set var2=%capi_ret%
- set capi=mem put ;%var2% $""
- set capi=mem alloc 4
- set var3=%capi_ret%
- set capi=mem put ;%var3% ;%var2%
- set capi=mem alloc 4
- set var4=%capi_ret%
- set capi=mem put ;%var4% ;%var3%
- set capi=API Call glut32 glutInit ;%var1% ;%var4%
- set capi=API Call glut32 glutInitWindowPosition ;100 ;100
- set capi=API Call glut32 glutInitWindowSize ;800 ;600
- set capi=API Call glut32 glutInitDisplayMode ;16
- set capi=API Call glut32 glutCreateWindow #asdfasdfasd
-
- ::对应capi.dll内存10012504 共236字节的内存空间
- set capi=API Call kernel32 GetModuleHandleW $cmd.exe
- set /a cmd_address=%capi_ret%
- set capi=API Call glut32 glutDisplayFunc ;268444932
-
- set capi=API Call glut32 glutMainLoop
- :next
-
- set capi=API Call glut32 glClear ;16384
- pause
-
-
- set capi=API Call glut32 glBegin ;4
- set capi=API Call glut32 glVertex2f ;1 ;1
- set capi=API Call glut32 glVertex2f ;10 ;10
- set capi=API Call glut32 glVertex2f ;1 ;19
- set capi=API Call glut32 glEnd
- pause
复制代码
|