Skip to content

Commit 6ddc54c

Browse files
author
Michele Tampellini
committed
multiple context hack
1 parent 02387f1 commit 6ddc54c

File tree

4 files changed

+778
-687
lines changed

4 files changed

+778
-687
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*******************************************************************************************
2+
*
3+
* raylib [core] example - Basic window
4+
*
5+
* Welcome to raylib!
6+
*
7+
* To test examples in Notepad++, provided with default raylib installer package,
8+
* just press F6 and run [raylib_compile_execute] script, it will compile and execute.
9+
* Note that compiled executable is placed in the same folder as .c file
10+
*
11+
* You can find all basic examples on [C:\raylib\raylib\examples] directory and
12+
* raylib official webpage: [www.raylib.com]
13+
*
14+
* Enjoy using raylib. :)
15+
*
16+
* This example has been created using raylib 1.0 (www.raylib.com)
17+
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
18+
*
19+
* Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
20+
*
21+
********************************************************************************************/
22+
23+
#include "raylib.h"
24+
25+
int main(void)
26+
{
27+
// Initialization
28+
//--------------------------------------------------------------------------------------
29+
const int screenWidth = 800;
30+
const int screenHeight = 450;
31+
32+
InitWindow(screenWidth, screenHeight, "raylib [core] example - window 1");
33+
InitWindow(screenWidth, screenHeight, "raylib [core] example - window 2");
34+
35+
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
36+
//--------------------------------------------------------------------------------------
37+
38+
// Main game loop
39+
while (!WindowShouldClose()) // Detect window close button or ESC key
40+
{
41+
// Update
42+
//----------------------------------------------------------------------------------
43+
// TODO: Update your variables here
44+
//----------------------------------------------------------------------------------
45+
46+
// Draw
47+
//----------------------------------------------------------------------------------
48+
BeginDrawing(0);
49+
50+
ClearBackground(RAYWHITE);
51+
52+
DrawText("Congrats! You created your FIST window!", 190, 200, 20, LIGHTGRAY);
53+
54+
EndDrawing();
55+
56+
BeginDrawing(1);
57+
58+
ClearBackground(RAYWHITE);
59+
60+
DrawText("Congrats! You created your SECOND window!", 190, 200, 20, LIGHTGRAY);
61+
62+
EndDrawing();
63+
//----------------------------------------------------------------------------------
64+
}
65+
66+
// De-Initialization
67+
//--------------------------------------------------------------------------------------
68+
CloseWindow(); // Close window and OpenGL context
69+
//--------------------------------------------------------------------------------------
70+
71+
return 0;
72+
}

0 commit comments

Comments
 (0)