Skip to content

Commit

Permalink
samples
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Apr 4, 2024
1 parent bc1429c commit 9e6d4bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions crates/samples/windows/dcomp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl Window {
None,
)?;

let bitmap = dc.CreateBitmapFromWicBitmap2(&self.image, None)?;
let bitmap = dc.CreateBitmapFromWicBitmap(&self.image, None)?;
let width = logical_to_physical(CARD_WIDTH, self.dpi.0);
let height = logical_to_physical(CARD_HEIGHT, self.dpi.1);

Expand Down Expand Up @@ -732,13 +732,14 @@ fn draw_card_back(
bitmap,
None,
1.0,
D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
D2D1_INTERPOLATION_MODE_LINEAR,
Some(&D2D_RECT_F {
left,
top,
right: left + CARD_WIDTH,
bottom: top + CARD_HEIGHT,
}),
None,
);

surface.EndDraw()
Expand Down
8 changes: 4 additions & 4 deletions crates/samples/windows/direct2d/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct Window {
handle: HWND,
factory: ID2D1Factory1,
dxfactory: IDXGIFactory2,
style: ID2D1StrokeStyle,
style: ID2D1StrokeStyle1,
manager: IUIAnimationManager,
variable: IUIAnimationVariable,

Expand Down Expand Up @@ -310,7 +310,7 @@ impl Window {
..Default::default()
};

unsafe { target.CreateBitmap2(size_u, None, 0, &properties) }
unsafe { target.CreateBitmap(size_u, None, 0, &properties) }
}

fn resize_swapchain_bitmap(&mut self) -> Result<()> {
Expand Down Expand Up @@ -506,8 +506,8 @@ fn create_factory() -> Result<ID2D1Factory1> {
unsafe { D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, Some(&options)) }
}

fn create_style(factory: &ID2D1Factory1) -> Result<ID2D1StrokeStyle> {
let props = D2D1_STROKE_STYLE_PROPERTIES {
fn create_style(factory: &ID2D1Factory1) -> Result<ID2D1StrokeStyle1> {
let props = D2D1_STROKE_STYLE_PROPERTIES1 {
startCap: D2D1_CAP_STYLE_ROUND,
endCap: D2D1_CAP_STYLE_TRIANGLE,
..Default::default()
Expand Down

0 comments on commit 9e6d4bc

Please sign in to comment.