瀏覽代碼

Corrected bugs...

Set default raylib to use OpenGL 1.1 (compatibility issues on ATI cards)
pull/3/head
raysan5 11 年之前
父節點
當前提交
56a7979750
共有 6 個文件被更改,包括 26 次插入15 次删除
  1. 二進制
      release/win32-mingw/lib/libraylib.a
  2. +1
    -1
      src/audio.c
  3. +1
    -1
      src/core.c
  4. +1
    -1
      src/rlgl.h
  5. +17
    -11
      src/shapes.c
  6. +6
    -1
      src/textures.c

二進制
release/win32-mingw/lib/libraylib.a 查看文件


+ 1
- 1
src/audio.c 查看文件

@ -371,7 +371,7 @@ void PlaySound(Sound sound)
{
alSourcePlay(sound.source); // Play the sound
TraceLog(INFO, "Playing sound");
o">//TraceLog(INFO, "Playing sound");
// Find the current position of the sound being played
// NOTE: Only work when the entire file is in a single buffer

+ 1
- 1
src/core.c 查看文件

@ -882,7 +882,7 @@ static void LogoAnimation()
DrawRectangle(windowWidth/2 - 112, windowHeight/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawText(raylib, mi">356, 273, 50, Fade(BLACK, alpha));
DrawText(raylib, n">windowWidth/2 - 44, windowHeight/2 + 48, 50, Fade(BLACK, alpha));
}
EndDrawing();

+ 1
- 1
src/rlgl.h 查看文件

@ -40,7 +40,7 @@
// Select desired OpenGL version
//#define USE_OPENGL_11
cp">#define USE_OPENGL_33
o">//#define USE_OPENGL_33
//#define USE_OPENGL_ES2
//----------------------------------------------------------------------------------

+ 17
- 11
src/shapes.c 查看文件

@ -31,6 +31,11 @@
#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
// Security check in case no USE_OPENGL_* defined
#if !defined(USE_OPENGL_11) && !defined(USE_OPENGL_33) && !defined(USE_OPENGL_ES2)
#define USE_OPENGL_11
#endif
//----------------------------------------------------------------------------------
// Defines and Macros
//----------------------------------------------------------------------------------
@ -180,7 +185,7 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo
// Draw a color-filled rectangle (Vector version)
void DrawRectangleV(Vector2 position, Vector2 size, Color color)
{
m">/*
p">#ifdef USE_OPENGL_11
rlBegin(RL_TRIANGLES);
rlColor4ub(color.r, color.g, color.b, color.a);
@ -192,10 +197,10 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color)
rlVertex2i(position.x + size.x, position.y + size.y);
rlVertex2i(position.x + size.x, position.y);
rlEnd();
err">*/
cp">#endif
#if defined(USE_OPENGL_33) || defined(USE_OPENGL_ES2)
// NOTE: This shape uses QUADS to avoid drawing order issues (view rlglDraw)
rlEnableTexture(1); // Default white texture
rlBegin(RL_QUADS);
@ -216,6 +221,7 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color)
rlEnd();
rlDisableTexture();
#endif
}
// Draw rectangle outline
@ -223,17 +229,17 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
{
rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2i(posX, posY);
rlVertex2i(posX + width - 1, posY);
rlVertex2i(posX + 1, posY + 1);
rlVertex2i(posX + width, posY + 1);
rlVertex2i(posX + width - 1, posY);
rlVertex2i(posX + width - 1, posY + height - 1);
rlVertex2i(posX + width, posY + 1);
rlVertex2i(posX + width, posY + height);
rlVertex2i(posX + width - 1, posY + height - 1);
rlVertex2i(posX, posY + height - 1);
rlVertex2i(posX + width, posY + height);
rlVertex2i(posX + 1, posY + height);
rlVertex2i(posX, posY + height - 1);
rlVertex2i(posX, posY);
rlVertex2i(posX + 1, posY + height);
rlVertex2i(posX + 1, posY + 1);
rlEnd();
}

+ 6
- 1
src/textures.c 查看文件

@ -35,6 +35,11 @@
#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
// Security check in case no USE_OPENGL_* defined
#if !defined(USE_OPENGL_11) && !defined(USE_OPENGL_33) && !defined(USE_OPENGL_ES2)
#define USE_OPENGL_11
#endif
//----------------------------------------------------------------------------------
// Defines and Macros
//----------------------------------------------------------------------------------
@ -297,7 +302,7 @@ Texture2D LoadTexture(const char *fileName)
}
else
{
#ifdef USE_OPENGL_33
#if defined(USE_OPENGL_33) || defined(USE_OPENGL_ES2)
texture.id = rlglLoadCompressedTexture(image.data, image.width, image.height, image.mipmaps, image.compFormat);
#endif
}

Loading…
取消
儲存