Hajime Hoshi
8b72ff5ec0
graphicscommand: Add tests
2018-12-16 17:38:02 +09:00
Hajime Hoshi
2c25318634
shareable: Add TestReplacePixelsAfterDrawImage
2018-12-16 15:13:35 +09:00
Hajime Hoshi
5f8a0e34bb
graphics: isPowerOf2(0 or negative) should return false
2018-12-16 14:26:16 +09:00
Hajime Hoshi
17b225083d
shareable: Improve TestExtend
2018-12-16 05:09:43 +09:00
Hajime Hoshi
22b11aafac
shareable: Add TestExtend
2018-12-15 19:51:17 +09:00
Hajime Hoshi
d29cabca43
graphicsdriver: Remove MaxImageSize
2018-12-15 03:46:32 +09:00
Hajime Hoshi
18d109e3df
graphicsdriver/opengl/gl: Fix README
2018-12-09 04:41:43 +09:00
Hajime Hoshi
e8a1be7748
graphicsdriver/opengl: Use non-cgo gl package on Windows ( #171 )
...
This is a temporal fix until go-gl/glow#102 is applied.
2018-12-09 03:06:11 +09:00
Hajime Hoshi
2fd0daec10
ui: Fix comments
2018-12-04 03:10:54 +01:00
Hajime Hoshi
155ee828b8
Fix misspelling
2018-12-03 18:23:25 +01:00
Hajime Hoshi
f85a62c6a7
restorable: Rename dummyImage -> emptyImage
2018-12-01 21:49:41 +01:00
Hajime Hoshi
e537cb2c27
graphics: Bug fix: render source might not be initialized
2018-12-01 21:36:51 +01:00
Hajime Hoshi
3f75da5f35
restorable: Refactoring: Remove newImageWithoutInit
2018-12-01 21:36:51 +01:00
Hajime Hoshi
c6dd0a75d9
graphicscommand: Optimize replace-image calls
...
Now ReplacePixels command is called only when necessary.
This also ensures that DrawImage must be called after ReplacePixels
is called since there is a potential problem that rendering images
on a texture without initializing by replacing pixels might cause
problems (escpecially on Metal. Perhaps #593 might be related).
2018-12-01 21:36:47 +01:00
Hajime Hoshi
e799a0c6a8
shareable: Fix wrong variable names
2018-12-01 11:31:32 +01:00
Hajime Hoshi
247e4f5b6b
restorable: Skip initializing the screen image
2018-11-30 00:19:52 +01:00
Hajime Hoshi
962a11468b
restorable: Fix clearing logic
...
Fixes #740
2018-11-28 23:00:24 +01:00
Hajime Hoshi
1a54ff34e6
graphics: Forbid nil at ReplacePixels explicitly
2018-11-28 22:26:34 +01:00
Hajime Hoshi
1f538af440
restorable: Refactoring
2018-11-24 21:08:28 +09:00
Hajime Hoshi
d165673789
devicescale: Bug fix: Crash on Wine
...
GetWindowDC(0) doesn't work on Wine. Let that return an arbitrary
scale 1 in this case.
Fixes #738
2018-11-24 16:37:30 +09:00
Hajime Hoshi
b48d501bc0
graphics: Explicit limitation of indices at DrawTriangles
...
Fixes #728
2018-11-23 19:02:10 +09:00
Hajime Hoshi
62210c89f3
graphicsdriver/opengl: Add assertion at ReplacePixels
2018-11-18 02:09:44 +09:00
Hajime Hoshi
31f15bc5ad
Revert "graphics: Change the number of floats for a vertex from 10 to 12"
...
This reverts commit 7586c660d5
.
2018-11-18 00:07:15 +09:00
Hajime Hoshi
d8f337985d
graphicsdriver/opengl: Refactoring
2018-11-17 22:40:21 +09:00
Hajime Hoshi
ef08e218c8
graphicsdriver/opengl: Refactoring: Remove framebuffer.projectionMatrix
2018-11-17 22:29:04 +09:00
Hajime Hoshi
14f5a03a79
Merge math and graphics packages
2018-11-17 20:23:12 +09:00
Hajime Hoshi
de745f00fa
graphicsdriver/opengl: Refactoring: Improve logic to generate framebuffer
2018-11-17 19:49:30 +09:00
Hajime Hoshi
44d1b137e7
graphicsdriver/opengl: Refactoring
2018-11-17 19:29:52 +09:00
Hajime Hoshi
7586c660d5
graphics: Change the number of floats for a vertex from 10 to 12
...
This is a preparation for Metal, that forces 4 floats for a vertex
position.
2018-11-17 15:30:11 +09:00
Hajime Hoshi
d2595c5be7
ui: Refactoring
2018-11-15 01:08:36 +09:00
Hajime Hoshi
e24f6b7848
graphicsdriver/opengl: Rename GetDriver -> Get
2018-11-13 00:01:26 +09:00
Hajime Hoshi
2313f79160
graphicsdriver: Rename Delete -> Dispose
2018-11-12 23:44:39 +09:00
Hajime Hoshi
cc2174bd69
graphicsdriver: Adjust API
2018-11-11 23:57:23 +09:00
Hajime Hoshi
907a28c434
graphicsdriver: Rename BufferSubData -> SetVertices
2018-11-11 23:54:58 +09:00
Hajime Hoshi
846a719d6c
graphicsdriver: Merge UseProgram and DrawElements into Draw
2018-11-11 23:53:23 +09:00
Hajime Hoshi
575af7e416
graphicsdriver: Change indexOffsetInBytes -> indexOffset at DrawElements
2018-11-11 23:51:16 +09:00
Hajime Hoshi
b2b51fb1bf
graphicsdriver/opengl: Refactoring
2018-11-11 22:08:36 +09:00
Hajime Hoshi
aff77d98e4
graphicsdriver/opengl: Bug fix: compile error on browsers and mobiles
2018-11-11 04:51:17 +09:00
Hajime Hoshi
734aeabc8d
graphicsdriver/opengl: Remove theContext
2018-11-11 03:37:37 +09:00
Hajime Hoshi
2f692d98c7
graphicsdriver: Rename TexSubImage2D -> ReplacePixels
2018-11-11 01:35:10 +09:00
Hajime Hoshi
61ca48225c
graphicsdriver: Rename MaxTextureSize -> MaxImageSize
2018-11-11 01:26:37 +09:00
Hajime Hoshi
7e363a6f3b
graphicsdriver/opengl: Unexport Context
2018-11-11 01:19:11 +09:00
Hajime Hoshi
241716d0e6
Add package graphicsdriver; Move opengl to graphicsdriver/opengl
2018-11-10 22:52:37 +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
Hajime Hoshi
b2b09ccec0
restorable: Avoid memory allocating when an entire image is cleared
2018-10-30 11:08:38 +09:00
Hajime Hoshi
bb0b8ca83b
opengl: Unexport (*Context).Reset()
2018-10-30 02:18:10 +09:00
Hajime Hoshi
ac7bf354a9
opengl: Unexport types
2018-10-30 02:13:51 +09:00
Hajime Hoshi
e4179aee37
opengl: Unexport functions
2018-10-30 01:50:30 +09:00
Hajime Hoshi
6b95a5140c
opengl: Move program.go and shader.go to opengl
2018-10-30 01:27:31 +09:00
Hajime Hoshi
6b02f0ae9e
graphicscommand: Move OrthoProjectionMatrix to opengl package
2018-10-29 01:08:51 +09:00
Hajime Hoshi
ce1c616f69
Merge graphics and graphicsutil
2018-10-28 23:03:06 +09:00
Hajime Hoshi
395b46d8da
graphicsutil: Remove dependency on graphicscommand
2018-10-28 23:00:10 +09:00
Hajime Hoshi
7767bcfdd8
graphicsutil: Better allocation of vertices
2018-10-28 22:54:36 +09:00
Hajime Hoshi
fde9fd2d0e
graphicsutil: Remove dependency on opengl
2018-10-28 22:01:59 +09:00
Hajime Hoshi
ff54d3b681
Move CompositeMode to graphics package
2018-10-28 21:49:47 +09:00
Hajime Hoshi
06f2052817
Add graphics package and move Filter to graphics
2018-10-28 20:25:52 +09:00
Hajime Hoshi
2da5192510
Rename graphics -> graphicscommand
2018-10-28 20:10:05 +09:00
Hajime Hoshi
7e29a81177
ui: Refactoring
2018-10-14 18:28:27 +09:00
Hajime Hoshi
0c4ef7ee8e
ui: Bug fix: fix the initial window position on multiple monitors
2018-10-14 16:59:14 +09:00