• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang vu.New函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/gazed/vu.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: ff

// ff demonstrates flow field path finding by having a bunch of chasers and
// a goal. The goal is randomly reset once all the chasers have reached it.
// Restarting the example will create a different random grid.
func ff() {
	ff := &fftag{}
	if err := vu.New(ff, "Flow Field", 400, 100, 750, 750); err != nil {
		log.Printf("ff: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:10,代码来源:ff.go


示例2: rl

// rl, random levels, tests higher level graphics functionality.
// This includes:
//   • vu culling/reducing the total objects rendered based on distance.
//   • vu 2D overlay scene, in this case a minimap.
//   • vu grid generation. Try numbers 0-9.
//   • vu engine statistics.
// rl also tests camera movement that includes holding multiple movement keys
// at the same time. The example does not have collision detection so you can
// literally run through the maze.
func rl() {
	rl := &rltag{}
	if err := vu.New(rl, "Random Levels", 400, 100, 800, 600); err != nil {
		log.Printf("rl: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:16,代码来源:rl.go


示例3: sg

// sg tests the scene graph by building up a movable character that has multiple
// layers of sub-parts. The scene graph is demonstrated by changing the top level
// location, orientation and having it affect the sub-parts. Sg also tests adding
// and removing parts from a scene graph. Note that transparency sorting is
// handled by the engine.
//
// This example has a bit more code due to playing around with what can best
// be described as merging and splitting voxels.
func sg() {
	sg := &sgtag{}
	if err := vu.New(sg, "Scene Graph", 400, 100, 800, 600); err != nil {
		log.Printf("sg: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:15,代码来源:sg.go


示例4: ps

// ps demonstrates a CPU-based particle system and a GPU-based (shader only)
// particle system with support provided by vu/Effect.
func ps() {
	ps := &pstag{}
	if err := vu.New(ps, "Particle System", 400, 100, 800, 600); err != nil {
		log.Printf("ps: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:9,代码来源:ps.go


示例5: tm

// tm demonstrates creating, texturing, and rendering a dynamic terrain map
// from a generated height map. The intent is to mimic a surface/land map.
func tm() {
	tm := &tmtag{}
	if err := vu.New(tm, "Terrain Map", 400, 100, 800, 600); err != nil {
		log.Printf("tm: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:9,代码来源:tm.go


示例6: bb

// bb tests the engines handling of billboards and banners as well
// as combining multiple textures using shaders.
func bb() {
	bb := &bbtag{}
	if err := vu.New(bb, "Billboarding & Banners", 400, 100, 800, 600); err != nil {
		log.Printf("bb: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:9,代码来源:bb.go


示例7: lt

// lt tests the engines handling of some of the engine lighting shaders.
// It also checks the conversion of light position and normal vectors
// needed for proper lighting.
func lt() {
	lt := &lttag{}
	if err := vu.New(lt, "Lighting", 400, 100, 800, 600); err != nil {
		log.Printf("lt: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:10,代码来源:lt.go


示例8: kc

// kc explores treating the keyboard as a controller.
// It assigns each keyboard key a unique symbol.
func kc() {
	kc := &kctag{}
	if err := vu.New(kc, "Keyboard Controller", 200, 200, 900, 400); err != nil {
		log.Printf("kc: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:9,代码来源:kc.go


示例9: ma

// ma, model animation, is an example of loading and animating a model using
// skeletel animation. It is based on the example data provided in the IQM
// Development kit from http://sauerbraten.org/iqm.
func ma() {
	ma := &matag{}
	if err := vu.New(ma, "Model Animation", 400, 100, 800, 600); err != nil {
		log.Printf("ma: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:10,代码来源:ma.go


示例10: fm

// fm demos and tests the vu/form package by visualizing grid layouts
// created from string based layout plans. Overall this is an experiment
// in trying to provide some application GUI support.
func fm() {
	fm := &fmtag{}
	if err := vu.New(fm, "Form Layout", 400, 100, 800, 600); err != nil {
		log.Printf("fm: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:10,代码来源:fm.go


示例11: rc

// rc demonstrates ray-casting and mouse-picking. In this example the plane
// is centered at the origin and the camera is tilted 45 degrees around X.
func rc() {
	rc := &rctag{}
	if err := vu.New(rc, "Ray Cast", 400, 100, 800, 600); err != nil {
		log.Printf("rc: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:9,代码来源:rc.go


示例12: cr

// cr, collision resolution, demonstrates simulated physics by having balls bounce
// on a floor. The neat thing is that after the initial locations have been set
// the physics simulation (vu/move) handles all subsequent position updates.
func cr() {
	cr := &crtag{}
	if err := vu.New(cr, "Collision Resolution", 400, 100, 800, 600); err != nil {
		log.Printf("cr: error initializing engine %s", err)
	}
	defer catchErrors()
}
开发者ID:toophy,项目名称:vu,代码行数:10,代码来源:cr.go


示例13: tt

// tt demonstrates rendering to a scene to a texture, and then
// displaying the scene on a quad. Background info at:
//   http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/
//   http://processors.wiki.ti.com/index.php/Render_to_Texture_with_OpenGL_ES
//   http://in2gpu.com/2014/09/24/render-to-texture-in-opengl/
//   http://www.lighthouse3d.com/tutorials/opengl_framebuffer_objects/
func tt() {
	tt := &totex{}
	if err := vu.New(tt, "Render to Texture", 400, 100, 800, 600); err != nil {
		log.Printf("tt: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:13,代码来源:tt.go


示例14: sm

// sm, shadow map, tests the engines handling of shadow maps
// and multipass rendering. These are hard shadows.
// FUTURE: upgrade shader to PCSS ie:
//   http://developer.download.nvidia.com/whitepapers/2008/PCSS_Integration.pdf
func sm() {
	sm := &smtag{}
	if err := vu.New(sm, "Shadow Map", 400, 100, 800, 600); err != nil {
		log.Printf("sm: error starting engine %s", err)
	}
	defer catchErrors()
}
开发者ID:skyview059,项目名称:vu,代码行数:11,代码来源:sm.go


示例15: main

// main recovers saved preferences and initializes the game.
func main() {
	mp := &bampf{}
	var err error
	var x, y int
	x, y, mp.ww, mp.wh, mp.mute = mp.prefs()
	mp.setLogger(mp)
	if err = vu.New(mp, "Bampf", x, y, mp.ww, mp.wh); err != nil {
		logf("Failed to initialize engine %s", err)
		return
	}
	defer catchErrors()
}
开发者ID:kissthink,项目名称:bampf,代码行数:13,代码来源:bampf.go



注:本文中的github.com/gazed/vu.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang vu.Eng类代码示例发布时间:2022-05-23
下一篇:
Golang utf88.Text函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap