-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
When I call LoadFileText it returns a ByteBuffer with the capacity of 1 regardless of the content of the file loaded.
package com.redfox.platformer;
import java.nio.ByteBuffer;
import static com.raylib.Colors.RAYWHITE;
import com.raylib.Raylib;
import static com.raylib.Raylib.BeginDrawing;
import static com.raylib.Raylib.ClearBackground;
import static com.raylib.Raylib.CloseWindow;
import static com.raylib.Raylib.EndDrawing;
import static com.raylib.Raylib.InitWindow;
import static com.raylib.Raylib.WindowShouldClose;
public class Game {
public static void main(String[] args) {
int screenWidth = 800;
int screenHeight = 600;
InitWindow(screenWidth, screenHeight, "raygui");
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(RAYWHITE);
EndDrawing();
}
CloseWindow();
ByteBuffer text = Raylib.LoadFileText("resources\\Text.txt");
System.out.println(text.capacity()); // 1
while(text.hasRemaining())
{
System.out.printf("%c", (char)text.get());
}
System.out.println();
}
}
resources/Text.txt:
esfsdfsdfsdfs
sdfsdfds
Metadata
Metadata
Assignees
Labels
No labels