2021SC@SDUSC
Go语言的简单2D游戏库-Ebiten
目录
type replacePixelsCommand struct
type disposeImageCommand struct
func InitializeGraphicsDriverState
概览
包 graphicscommand 表示使用 OpenGL 的图形的低层。
主要围绕几个主要的结构体和函数展开分析
type command interface
命令表示图形命令。
是在调用图像函数(如DrawTriangles)或填充时创建的绘图命令,
命令创建后不会立即执行。已安装,创建后将排队,只有在必要时才执行。
type commandQueue struct
commandQueue是用于图形命令的命令队列。
commands是图形命令的队列。
vertices表示OpenGL数组缓冲区中的顶点数据
nvertices表示顶点的当前长度 nvertices必须<=len(vertices)。
vertices永远不会收缩,因为重新扩展顶点缓冲区很费力。同时,这是一些float32值,而不是一些顶点 重命名或修复程序。
theCommandQueue
var theCommandQueue = &commandQueue{}
theCommandQueue是当前进程的命令队列