2021SC@SDUSC Ebiten(七) 图形命令代码详解

2021SC@SDUSC 

Go语言的简单2D游戏库-Ebiten   

 

目录

概览 

type command interface

 type commandQueue struct

theCommandQueue 

func appendVertices

func Enqueue

func Flush

type replacePixelsCommand struct

func Exec 

type disposeImageCommand struct

func Exec

type Image

func (*Image) Dump 

func (*Image) Pixels

func InitializeGraphicsDriverState

func ResetGraphicsDriverStat


概览 

包 graphicscommand 表示使用 OpenGL 的图形的低层。

主要围绕几个主要的结构体和函数展开分析

type command interface

命令表示图形命令。

是在调用图像函数(如DrawTriangles)或填充时创建的绘图命令,

命令创建后不会立即执行。已安装,创建后将排队,只有在必要时才执行。

 type commandQueue struct

commandQueue是用于图形命令的命令队列。

commands是图形命令的队列。

vertices表示OpenGL数组缓冲区中的顶点数据

nvertices表示顶点的当前长度  nvertices必须<=len(vertices)。

vertices永远不会收缩,因为重新扩展顶点缓冲区很费力。同时,这是一些float32值,而不是一些顶点  重命名或修复程序。

theCommandQueue 

var theCommandQueue = &commandQueue{}

theCommandQueue是当前进程的命令队列

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值