Commit Graph

3679 Commits

Author SHA1 Message Date
Hajime Hoshi
dfb63852c2 graphics: Refactoring 2018-11-09 01:40:05 +09:00
Hajime Hoshi
03c800cb9b graphics: Bug fix: wrong region on a subimage 2018-11-09 01:40:02 +09:00
Hajime Hoshi
ebffaeba3d examples/minify: Better clipping 2018-11-09 01:08:32 +09:00
Hajime Hoshi
9f0d14dd05 graphics: Add tests for #732 2018-11-09 00:48:21 +09:00
Hajime Hoshi
f54bdfa159 Reland: graphics: Bug fix: a sub image's Size was wrong
Size() usages are also fixed.

Fixes #732
2018-11-08 12:58:14 +09:00
Hajime Hoshi
27331024af Revert "graphics: Bug fix: a sub image's Size was wrong"
This reverts commit 76ac850f6b.

Reason: This breaks many examples
2018-11-08 12:19:38 +09:00
Hajime Hoshi
76ac850f6b graphics: Bug fix: a sub image's Size was wrong
Fixes #732
2018-11-08 04:22:19 +09:00
Hajime Hoshi
859cfa14ac Add Ben Echols to AUTHORS 2018-11-07 20:56:34 +09:00
Ben Echols
5e70fce639 Added monitor cache and scale cache (#731) 2018-11-07 20:54:37 +09:00
Hajime Hoshi
b396b4f88a opengl: Refactoring: Remove theOpenGLState 2018-11-07 02:01:00 +09:00
Hajime Hoshi
09c8516545 graphcis: Move IndicesNum from opengl to graphics 2018-11-07 01:49:45 +09:00
Hajime Hoshi
07ae1db0dd opengl: Add Driver 2018-11-07 01:43:07 +09:00
Hajime Hoshi
ed961505d2 opengl: Refactoring: Hide projection matrix inside opengl package 2018-11-06 03:45:44 +09:00
Hajime Hoshi
57c8c089e9 opengl: Unexport BlendFunc 2018-11-06 03:18:56 +09:00
Hajime Hoshi
c9f49efd41 graphics: Add VertexFlaotNum 2018-11-06 02:34:52 +09:00
Hajime Hoshi
580cd5cc71 opengl: Unexport DataType/Float/Short 2018-11-06 01:58:15 +09:00
Hajime Hoshi
82e9f227d1 opengl: Remove arrayBufferLayoutPart.dataType 2018-11-06 01:13:55 +09:00
Hajime Hoshi
00f28dd896 opengl: Remove BeforeSwapping
I couldn't machines that requre this any longer. Perhaps a bound
framebuffer is always the screen framebuffer before swapping now.
2018-11-05 02:14:56 +09:00
Hajime Hoshi
2c7017534f ui: Remove opengl dependency from ui package (desktop) 2018-11-05 01:24:53 +09:00
Hajime Hoshi
02b570a8e1 opengl: Refactoring: Use value type for theContext 2018-11-05 00:48:15 +09:00
Hajime Hoshi
f7fa4ed8f9 opengl: Refactoring 2018-11-05 00:44:27 +09:00
Hajime Hoshi
4090258904 opengl: Remove Init (except for mobile) 2018-11-05 00:21:39 +09:00
Hajime Hoshi
16ada03928 opengl: Unexport (*Image).Framebuffer 2018-11-04 20:00:13 +09:00
Hajime Hoshi
293857d3a3 opengl: Remove (*Image).Size 2018-11-04 19:59:27 +09:00
Hajime Hoshi
beae772287 opengl: Unexport Framebuffer 2018-11-04 19:55:27 +09:00
Hajime Hoshi
7bbc32ce0e opengl: Unexport Texture 2018-11-04 19:46:20 +09:00
Hajime Hoshi
786b349579 opengl: Unexport TexSubImage2D 2018-11-04 19:44:30 +09:00
Hajime Hoshi
531251d4ad opengl: Unexport NewTexture 2018-11-04 19:39:14 +09:00
Hajime Hoshi
bc7dd2f050 opengl: Unexport some functions 2018-11-04 19:13:41 +09:00
Hajime Hoshi
2a7caf7755 opengl: Move ensureFramebuffer to opengl.Image 2018-11-04 19:06:33 +09:00
Hajime Hoshi
95a925ec9a opengl: Refactoring 2018-11-04 18:51:50 +09:00
Hajime Hoshi
7fbf9f652e opengl: Unexport DeleteTexture 2018-11-04 18:46:05 +09:00
Hajime Hoshi
96f1a8aff6 opengl: Add Image struct 2018-11-04 18:39:28 +09:00
Hajime Hoshi
c7ea761031 opengl: Rename FramebufferStruct -> Framebuffer 2018-11-04 17:49:40 +09:00
Hajime Hoshi
9dae11808f opengl: Rename Framebuffer -> framebufferNative 2018-11-04 17:48:45 +09:00
Hajime Hoshi
c935c28498 opengl: Move Framebuffer from graphicscommand to opengl and rename it to FramebufferStruct 2018-11-04 17:39:01 +09:00
Hajime Hoshi
97a9e99112 opengl: Rename: BindScreenFramebuffer -> BeforeSwapping 2018-11-03 04:08:00 +09:00
Hajime Hoshi
841353670f opengl: Unexport BindTexture 2018-11-02 03:45:37 +09:00
Hajime Hoshi
6dceeb343c opengl: Refactoring: Remove ResetViewportSize 2018-11-02 03:24:35 +09:00
Hajime Hoshi
09fe1886d7 graphicscommand: Add comments
Add explanation why ResetViewportSize is needed.
2018-11-02 03:06:26 +09:00
Hajime Hoshi
3a8ddd6279 graphicscontext: Rename createFramebufferIfNeeded -> ensureFramebuffer 2018-11-01 03:42:30 +09:00
Hajime Hoshi
61c2331ac4 graphicscommand: Refactoring 2018-11-01 03:34:58 +09:00
Hajime Hoshi
e28c7b0f50 graphicscommand: Remove Texture 2018-11-01 03:29:23 +09:00
Hajime Hoshi
bc3ca38f76 opengl: Rename ResetGLState -> Reset and other functions 2018-11-01 03:02:08 +09:00
Hajime Hoshi
b8aa35373a graphicscommand: Remove unneeded type conversion 2018-10-31 10:54:45 +09:00
seebs
74e204d952 graphics: Speed up DrawTriangles (#723)
DrawTriangles is expensive and slow because of massive memory
allocation and garbage collection costs. This patch moves from ~47TPS
on my laptop (with ~24k triangles) to 60TPS. The first part
is just allocating the right size of vertex buffer up front; that
got to about 55TPS. The second part replaces the frequent
allocations of []float32 in Vertex() calls with writing the
desired values into a provided destination slice.

Time spent in drawing triangles for 1,000 frames:
	13.07s	baseline
	11.09s	preallocate whole buffer to avoid resizing
	6.13s	use new PutVertex function

This might need some cleanup, but I think it's good evidence that
the design change is viable.
2018-10-31 10:53:17 +09:00
Hajime Hoshi
45017213a7 opengl: Unexport (Element)ArrayBufferSubData 2018-10-31 00:59:44 +09:00
Hajime Hoshi
5be08cac19 opengl: Unexport BindBuffer 2018-10-30 23:59:20 +09:00
Hajime Hoshi
23a832c0a7 opengl: Unexport consts 2018-10-30 22:41:05 +09:00
Hajime Hoshi
99594fe732 opengl: Remove type mode 2018-10-30 22:36:12 +09:00