【问题标题】:Does NBOpenGL really worth the effort?NBOpenGL 真的值得付出努力吗?
【发布时间】:2013-05-10 09:10:07
【问题描述】:

好的,所以我在东部假期期间尝试学习 Opengl ES 2(和 opengl 4),因为我意识到我的 GUI 并不需要雅典或矢量图形,因为无论如何我将主要处理 3d 图形。 (我的项目“Ephestos”将致力于为 pharo 创建一个 3d 应用程序,另请参见“blender”)

所以当我尝试运行演示时,我得到一个错误

NBMacGLContextDriver>>supportsCurrentPlatform
    "obviously, for Mac intel-32 only :)"
    ^ NativeBoost platformId = NativeBoostConstants mac32PlaformId

我的 mac“显然”不是 32 位而是 64 位,但我不知道这是否重要,因为无论如何 pharo 只是 32 位。这个bug也很明显,应该是mac32PlatformId而不是mac32PlaformId

我更正并继续,这次给了我一个新错误

NBMacGlApi>>glApiCall: fnSpec index: fnIndex attributes: attributes context: contextToRetry

    ^[
        (NBCallFailureHandler for: contextToRetry) retryWith: [ :targetClass :targetMethod |
            (NBFFICallout
                targetClass: targetClass targetMethod: targetMethod fnSpec: fnSpec)
                stdcall;
                generate: [ :gen | self emitCall: fnIndex generator: gen ]
        ]
    ] on: NBNativeCodeError do: [:err :handler |
        err errorCode = ErrorFnNotAvailable ifTrue: [
            "Native code is installed, but function pointer not loaded yet.
            Try to load function and retry the call"  
            (self tryGetFunctionPointer: (self class glFunctions at: fnIndex)) ifFalse: [ ^ err pass ].
            ^ handler retrySend
            ].
        err pass      
    ]

这里的问题是NBCallFailureHandler 无处可寻。一开始我以为我的 NB 版本落后,所以我从 smalltalk Hub 下载了最新的配置并做了

ConfigurationOfNativeboost loadStable.

它更新没有错误,但仍然找不到那个类。

所以我的问题是,与NBOpengl 或 了解Nativeboost 的工作原理并自己使用Opengl 会更好吗?

【问题讨论】:

    标签: opengl smalltalk pharo


    【解决方案1】:

    我会说是的。 NBOpenGL 是使用 NativeBoost 的 OpenGL 的预制包装器,因此它通过提供您需要手动执行的操作来节省您的时间。 花一些时间修复配置比花很多时间重新绑定要好。

    【讨论】:

    • 谢谢,我想我会这样做,尝试至少修复我的应用程序所需的部分。我只是想了解更多使用并了解该库及其问题的经验丰富的 smalltalkers 的意见。
    • 是的......配置也应该开箱即用。如果它不起作用,请在邮件列表中报告,以便维护人员可以修复它:)
    猜你喜欢
    • 2010-11-07
    • 1970-01-01
    • 2015-03-18
    • 2018-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-21
    • 1970-01-01
    相关资源
    最近更新 更多