Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define RAYGUI_IMPLEMENTATION
- #include <raygui.h>
- #include <raylib.h>
- #include <math.h>
- // #include "MyButton.c"
- // #include "Test.c"
- // #include "CastleModel.c"
- int main(void)
- {
- const int screenWidth = 800;
- const int screenHeight = 800;
- bool fullsize = false;
- // Camera cam;
- InitWindow(screenWidth,screenHeight, "raylib [core] example - basic window");
- // SetExitKey(KEY_LEFT_CONTROL & KEY_A);
- // ToggleFullscreen();
- SetTargetFPS(60); // Set our game to run at 60 frames-per-second
- //--------------------------------------------------------------------------------------
- // GetKeyPressed()
- // if (GetKeyPressed().'a')
- // {
- // /* code */
- // };
- double time,x;
- const double w = 300;
- x = 0;
- time = 0;
- // GuiDefaultProperty defaultProp;
- // defaultProp = TEXT_SIZE;
- // *TEXT_SIZE += 34;
- Image img = LoadImage("game/stars.png");
- Texture2D texture = LoadTextureFromImage(img);
- const int realScreenWidth = GetMonitorWidth(0);
- const int realScreenHeight = GetMonitorHeight(0);
- while (!WindowShouldClose()) // Detect window close button or ESC key
- {
- if (IsKeyPressed(KEY_A))
- {
- fullsize = !fullsize;
- };
- if (fullsize)
- {
- SetWindowSize(realScreenWidth,realScreenHeight);
- // ToggleFullscreen();
- } else
- {
- SetWindowSize(screenWidth,screenHeight);
- };
- // Update
- //----------------------------------------------------------------------------------
- // TODO: Update your variables here
- //----------------------------------------------------------------------------------
- // Vector3 vect;
- // vect.x = 400;
- // vect.y = 200;
- // vect.z = 10;
- // BeginMode3D(cam);
- // DrawModel(model,modelPosition,2,WHITE);
- // DrawSphere(vect,100,RED);
- // DrawGrid(32,32);
- // EndMode3D();
- // Draw
- //----------------------------------------------------------------------------------
- time += 0.016;
- x = sin (time)*w;
- if (But())
- {
- DrawText("PRESS",60,60,20,RED);
- };
- Fff();
- Rectangle rect;
- rect.x = 300;
- rect.y = 300;
- rect.width = 100;
- rect.height = 100;
- Color textcolor = GuiColorPicker(rect,WHITE);
- BeginDrawing();
- ClearBackground(BLACK);
- DrawText("Congrats! You created your first window!", x+200, 200, 64, textcolor);
- DrawCircle(200,200,50,GREEN);
- DrawFPS(10,10);
- DrawTexture(texture,250,100,WHITE);
- EndDrawing();
- //----------------------------------------------------------------------------------
- }
- UnloadTexture(texture);
- // De-Initialization
- //--------------------------------------------------------------------------------------
- CloseWindow(); // Close window and OpenGL context
- //--------------------------------------------------------------------------------------
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment