• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Graphics library for Mercury, including OpenGL bindings, TGA image reading, and X11, Win32, and SDL2 windowing and input.


Commit MetaInfo

Revisãoa62e13ca4f52ee7d43590a3833de166a9413a833 (tree)
Hora2023-06-27 04:11:09
AutorAlaskanEmily <emily@alas...>
CommiterAlaskanEmily

Mensagem de Log

Add color-buffer masked draw typeclasses. I thought we already had this?

Mudança Sumário

Diff

--- a/saffron.draw.m
+++ b/saffron.draw.m
@@ -12,6 +12,7 @@
1212
1313 :- use_module array.
1414 :- import_module list.
15+:- import_module pair.
1516 :- use_module thread.
1617 :- use_module thread.mvar.
1718
@@ -118,6 +119,21 @@
118119
119120 %-----------------------------------------------------------------------------%
120121
122+:- typeclass draw(Ctx, Group, Buffer)
123+ <= (draw(Ctx, Group), color_buffer(Ctx, Buffer), (Ctx -> Buffer)) where [
124+
125+ pred draw_color_mask(Ctx, Group, list.list(Buffer), io.io, io.io),
126+ mode draw_color_mask(in, in, in, di, uo) is det
127+].
128+
129+%-----------------------------------------------------------------------------%
130+
131+:- pred draw_color_mask(Ctx, pair(Group, list.list(Buffer)), io.io, io.io)
132+ <= draw(Ctx, Group, Buffer).
133+:- mode draw_color_mask(in, in, di, uo) is det.
134+
135+%-----------------------------------------------------------------------------%
136+
121137 :- pred raise_matrix_stack_error is erroneous.
122138
123139 %-----------------------------------------------------------------------------%
@@ -192,6 +208,13 @@ top_matrix(transform_state(_, [Matrix|_])) = Matrix.
192208 ) )
193209 ].
194210
211+%-----------------------------------------------------------------------------%
212+
213+draw_color_mask(Ctx, (Group - Buffers), !IO) :-
214+ draw_color_mask(Ctx, Group, Buffers, !IO).
215+
216+%-----------------------------------------------------------------------------%
217+
195218 raise_matrix_stack_error :-
196219 exception.throw(exception.software_error(
197220 "Tried to pop from an empty transform stack.")).