mirror of https://github.com/adamdruppe/arsd.git
Merge pull request #477 from analogjupiter/pixmappaint
PixmapPaint February ’25 update
This commit is contained in:
commit
852d932413
956
pixmappaint.d
956
pixmappaint.d
File diff suppressed because it is too large
Load Diff
|
@ -372,12 +372,6 @@ enum Scaling {
|
||||||
cssCover = cover, /// equivalent CSS: `object-fit: cover;`
|
cssCover = cover, /// equivalent CSS: `object-fit: cover;`
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
|
||||||
enum ScalingFilter {
|
|
||||||
nearest, /// nearest neighbor → blocky/pixel’ish
|
|
||||||
linear, /// (bi-)linear interpolation → smooth/blurry
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
struct PresenterConfig {
|
struct PresenterConfig {
|
||||||
Window window; ///
|
Window window; ///
|
||||||
|
@ -397,7 +391,7 @@ struct PresenterConfig {
|
||||||
Scaling scaling = Scaling.keepAspectRatio;
|
Scaling scaling = Scaling.keepAspectRatio;
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Filter
|
Scaling filter
|
||||||
+/
|
+/
|
||||||
ScalingFilter filter = ScalingFilter.nearest;
|
ScalingFilter filter = ScalingFilter.nearest;
|
||||||
|
|
||||||
|
@ -639,7 +633,7 @@ final class OpenGl3PixmapRenderer : PixmapRenderer {
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case linear:
|
case bilinear:
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
break;
|
break;
|
||||||
|
@ -748,7 +742,7 @@ final class OpenGl1PixmapRenderer : PixmapRenderer {
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case linear:
|
case bilinear:
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
break;
|
break;
|
||||||
|
@ -842,6 +836,40 @@ final class OpenGl1PixmapRenderer : PixmapRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/+
|
||||||
|
/++
|
||||||
|
Purely software renderer
|
||||||
|
+/
|
||||||
|
final class SoftwarePixmapRenderer : PixmapRenderer {
|
||||||
|
|
||||||
|
private {
|
||||||
|
PresenterObjectsContainer* _poc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WantsOpenGl wantsOpenGl() @safe pure nothrow @nogc {
|
||||||
|
return WantsOpenGl(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setup(PresenterObjectsContainer* container) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reconfigure() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/++
|
||||||
|
Schedules a redraw
|
||||||
|
+/
|
||||||
|
public void redrawSchedule() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/++
|
||||||
|
Triggers a redraw
|
||||||
|
+/
|
||||||
|
public void redrawNow() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+/
|
||||||
|
|
||||||
///
|
///
|
||||||
struct LoopCtrl {
|
struct LoopCtrl {
|
||||||
int interval; /// in milliseconds
|
int interval; /// in milliseconds
|
||||||
|
|
Loading…
Reference in New Issue