File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
korge-core/src/korlibs/graphics Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,24 @@ class AGBuffer : AGObject() {
6666 fun upload (data : Buffer ): AGBuffer =
6767 upload(data, needClone = true )
6868
69+ /* *
70+ * Marks this buffer as dirty, so it will be uploaded to the GPU later.
71+ */
72+ fun upload (): AGBuffer {
73+ markAsDirty()
74+ return this
75+ }
76+
77+ /* *
78+ * Wraps the given buffer, so it will be used as is.
79+ * This buffer can be modified later, and the changes will be reflected in the GPU after call to [upload] without arguments.
80+ */
81+ fun wrap (data : Buffer ): AGBuffer {
82+ mem = data
83+ markAsDirty()
84+ return this
85+ }
86+
6987 private fun upload (data : Buffer , needClone : Boolean ): AGBuffer {
7088 if (mem?.sizeInBytes == data.sizeInBytes) {
7189 // Do not mark as dirty if the data is the same
You can’t perform that action at this time.
0 commit comments