[feat] Desktop render color
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define ASM asm volatile
|
||||
#define COLOR_RGB EFI_GRAPHICS_OUTPUT_BLT_PIXEL
|
||||
|
||||
static unsigned int strlen(const char* arr) { // 获取string长度
|
||||
int i = 0;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void prepare(UINT32 width, UINT32 height, COLOR_RGB color = {144, 238, 145});
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <graphics/context.h>
|
||||
#include <graphics/draw.h>
|
||||
|
||||
void pf_print_char(char c, unsigned int basex, unsigned int basey,
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color = {255, 255, 255, 255}); // Pixel Font 打印字符
|
||||
void pf_print(const char* text, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color = {255, 255, 255, 255}); // Pixel Font 打印string
|
||||
void pf_reset_position(void); // 重设Pixel Font Cursor位置
|
||||
COLOR_RGB color = {255, 255, 255, 255}); // Pixel Font 打印字符
|
||||
void pf_print(const char* text, COLOR_RGB color = {255, 255, 255, 255}); // Pixel Font 打印string
|
||||
void pf_reset_position(void); // 重设Pixel Font Cursor位置
|
||||
@@ -3,12 +3,13 @@
|
||||
// 这个文件存在的目的是让graphics的draw功能不用每次传 GOP hr vr base
|
||||
|
||||
#include <efi.h>
|
||||
#include <common.h>
|
||||
|
||||
struct gfx_context {
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP;
|
||||
unsigned int hr;
|
||||
unsigned int vr;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base;
|
||||
COLOR_RGB *base;
|
||||
};
|
||||
|
||||
extern gfx_context g_gfx;
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
#include <efi.h>
|
||||
#include <graphics/context.h>
|
||||
|
||||
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color); // 画像素
|
||||
#define COLOR_RGB EFI_GRAPHICS_OUTPUT_BLT_PIXEL
|
||||
|
||||
void draw_pixel(unsigned int x, unsigned int y, COLOR_RGB color); // 画像素
|
||||
Reference in New Issue
Block a user