summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/dumbframebuffer.cpp15
-rw-r--r--libkms++/dumbframebuffer.h2
2 files changed, 8 insertions, 9 deletions
diff --git a/libkms++/dumbframebuffer.cpp b/libkms++/dumbframebuffer.cpp
index 0defd3a..abea762 100644
--- a/libkms++/dumbframebuffer.cpp
+++ b/libkms++/dumbframebuffer.cpp
@@ -18,17 +18,14 @@ namespace kms
{
DumbFramebuffer::DumbFramebuffer(Card &card, uint32_t width, uint32_t height, const string& fourcc)
- :Framebuffer(card, width, height)
+ :DumbFramebuffer(card, width, height, FourCCToPixelFormat(fourcc))
{
- uint32_t a, b, c, d;
- a = fourcc[0];
- b = fourcc[1];
- c = fourcc[2];
- d = fourcc[3];
-
- uint32_t code = ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24));
+}
- Create(width, height, code);
+DumbFramebuffer::DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format)
+ :Framebuffer(card, width, height)
+{
+ Create(width, height, (uint32_t)format);
}
DumbFramebuffer::~DumbFramebuffer()
diff --git a/libkms++/dumbframebuffer.h b/libkms++/dumbframebuffer.h
index 24e791a..25a3c2e 100644
--- a/libkms++/dumbframebuffer.h
+++ b/libkms++/dumbframebuffer.h
@@ -1,6 +1,7 @@
#pragma once
#include "framebuffer.h"
+#include "pixelformats.h"
namespace kms
{
@@ -8,6 +9,7 @@ class DumbFramebuffer : public Framebuffer
{
public:
DumbFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& fourcc);
+ DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format);
virtual ~DumbFramebuffer();
void print_short() const;