[rcore] using win32_clipboard on platforms rlfw and rgfw
This commit is contained in:
parent
ba5045963e
commit
057f7dc98f
1 changed files with 70 additions and 35 deletions
|
|
@ -1,34 +0,0 @@
|
|||
#include "raylib.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static Image img = {0};
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
InitWindow(800, 450, "[core] raylib clipboard image");
|
||||
SetTraceLogLevel(LOG_TRACE);
|
||||
SetTargetFPS(60);
|
||||
|
||||
Texture tex = {0};
|
||||
while(!WindowShouldClose()) {
|
||||
if (IsKeyDown(KEY_LEFT_CONTROL) && IsKeyPressed(KEY_V)) {
|
||||
#ifdef _WIN32
|
||||
img = GetClipboardImage();
|
||||
tex = LoadTextureFromImage(img);
|
||||
if(!IsTextureValid(tex)) {
|
||||
exit(98);
|
||||
} else {
|
||||
ExportImage(img, "Debug.bmp");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
||||
if (IsTextureValid(tex)) {
|
||||
DrawTexture(tex, 0, 10 + 21, WHITE);
|
||||
}
|
||||
DrawText("Print Screen and Crtl+V", 10, 10, 21, BLACK);
|
||||
EndDrawing();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue