Первые попытки рисовать
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const dvui = @import("dvui");
|
||||
const CpuRenderEngine = @import("CpuRenderEngine.zig");
|
||||
const Document = @import("../models/Document.zig");
|
||||
const basic_models = @import("../models/basic_models.zig");
|
||||
|
||||
pub const RenderEngine = union(enum) {
|
||||
@@ -16,4 +17,11 @@ pub const RenderEngine = union(enum) {
|
||||
.cpu => |cpu_r| cpu_r.example(canvas_size, visible_rect),
|
||||
};
|
||||
}
|
||||
|
||||
/// Растеризует документ в текстуру (размер и видимая область в пикселях холста).
|
||||
pub fn render(self: RenderEngine, document: *const Document, canvas_size: basic_models.ImageSize, visible_rect: basic_models.ImageRect) !?dvui.Texture {
|
||||
return switch (self) {
|
||||
.cpu => |cpu_r| cpu_r.renderDocument(document, canvas_size, visible_rect),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user