duanmo5724 2015-09-26 09:08
浏览 32

Golang OpenGL顶点结构

I'm working on an OpenGL application in Golang and am having some odd issues with getting Vertices to render properly after converting them to a struct instead of an array of point positions.

As an array of points, it works well though after changing it to a struct the behaviour is quite odd. It either flickers and then disappears or doesn't appear at all on launch.

I imagine I'm just doing something wrong somewhere in the OpenGL calls, though I can't imagine what it is. I'm fairly certain that doing it in this manner would work well in C++.

I've attached the before and after code of what I changed.

Thanks for any and all help =)

EDIT:: Oh, this behaviour happens when I change the *12 in the buffer length to *8, I was originally trying to do 3D coord, but that has the same effect.

Before ||| After

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 r包runway详细安装教程
    • ¥15 Html中读取Json文件中数据并制作表格
    • ¥15 谁有RH342练习环境
    • ¥15 STM32F407 DMA中断问题
    • ¥15 uniapp连接阿里云无法发布消息和订阅
    • ¥25 麦当劳点餐系统代码纠错
    • ¥15 轮班监督委员会问题。
    • ¥20 关于变压器的具体案例分析
    • ¥15 生成的QRCode圖片加上下載按鈕
    • ¥15 板材切割优化算法,数学建模,python,lingo