Code Monkey home page Code Monkey logo

rlimgui-cs's People

Contributors

chrisdill avatar jeffm2501 avatar jeffmblizzard avatar leftbones avatar noahstolk avatar swcreeperking avatar vincenthill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rlimgui-cs's Issues

Wrong Scissor Mode and broken FrameEvents

I believe the old EnableScissor(...) work more correctly than current one.
Before fb54b22f0bd36e27f20173eade71bb0c669a0538
6ed53c713c453c9398428154b993ef99b9145920
As you can see, the first screenshot is from commit 08a68d3c2d0ecac060c2a341232ddb901aecd4dc the second one is from 6ed53c713c453c9398428154b993ef99b9145920. It looks the old one works for me.
Currently I have daul monitor setup, both of them are 1080P and DPI is 125%.

Besides, I believe at line 446, it should be

                io.AddKeyEvent(keyItr.Value, Raylib.IsKeyDown(keyItr.Key));

instead of current one. Current one will crash directly.

M1 no visible ImGui output

Running this wrapper on an M1 machine will result in no visible / cut off output.

This problem can be solved on M1's (.NET 6.0) commenting out:
EnableScissor and Rlgl.rlDisableScissorTest() in rlImGui.cs.

ImGui glitches when it is out of screen

Hello,

First of all, thank you for the your great job. Your project has been very useful for me.

Now, going back to the matter, I have been testing your project and I found a weird behaviour of ImGui. When the window is place out side the screen on the left side, ImGui glitches. I have been checking your code but i dont find the issue. I have attached two videos showing the issue.

Any idea what it could be happening?

I am on macOS Sonoma 14.3.1 running on a M1 Max.

Test 1

Test_1_Editor_Example.mp4

Test 2

Test_2_Simple_Example.mp4

Method not found

Unhandled exception. System.MissingMethodException: Method not found: 'ImGuiNET.RangePtrAccessor`1<ImGuiNET.ImDrawListPtr> ImGuiNET.ImDrawDataPtr.get_CmdListsRange()
'.
   at rlImGui_cs.rlImGui.RenderData()
   at rlImGui_cs.rlImGui.End()
   at HelloWorld.Program.Main() in /Users/kyandesutter/development/formal-engine-rewrite/Program.cs:line 156

https://github.com/FormalSnake/formal-engine/tree/rewrite

Problem with 'io.KeysData'

For me this line crashes because there is an 'index out of range exception'.

foreach (var keyItr in RaylibKeyMap)
    io.KeysData[(int)keyItr.Value].Down = (byte)(Raylib.IsKeyDown(keyItr.Key) ? 1 : 0);

I figured that this is offset value is needed. It worked for me fine, text input is OK.
https://github.com/ocornut/imgui/blob/e265610a0c4143b9abc64c50a3950ddcd0243622/imgui.h#L1425


foreach (var keyItr in RaylibKeyMap)
	io.KeysData[(int)(keyItr.Value - ImGuiKey.KeysData_OFFSET)].Down = (byte)(Raylib.IsKeyDown(keyItr.Key) ? 1 : 0);

Custom fonts entirely broken & can cause memory corruption

I've been trying to get custom fonts working using rlImGui-cs for about 4 hours now - something that would take 20 seconds using C++ and ImGui - and I just can't figure it out.

I have tried:

  1. Just as in C++, getting the IoPtr and loading the font from a TTF file. This does nothing. The font does not get used.
  2. Doing 1, but then calling ReloadFonts. This does nothing.
  3. Doing 2, but then using PushFont. This causes a memory corruption error and crashes.
  4. Doing 1 & 2 in the InstallFonts callback.

None of these work. Do you have an functioning example of loading a custom font?

Some Elements not rendering correctly at fullscreen

I am on Linux, so I don't know if this is a raylib, this libary, or if I am doing something wrong

SetTraceLogLevel(TraceLogLevel.Error);
SetConfigFlags(ConfigFlags.ResizableWindow);
InitWindow(400, 300, "Window");
rlImGui.Setup(true);
while (!WindowShouldClose()) {
	BeginDrawing();
	ClearBackground(Color.Black);

	rlImGui.Begin();

	//
	bool open = true;
	ImGuiWindowFlags flags =
		ImGuiWindowFlags.NoDecoration |
		ImGuiWindowFlags.AlwaysAutoResize |
		ImGuiWindowFlags.NoSavedSettings |
		ImGuiWindowFlags.NoFocusOnAppearing |
		ImGuiWindowFlags.NoNav;
	ImGui.SetNextWindowPos(Vector2.One * 10f);
	flags |= ImGuiWindowFlags.NoMove;
	ImGui.Begin("test", ref open, flags);
	ImGui.Text("HERE");
	ImGui.End();
	//

	rlImGui.End();
	EndDrawing();
}

CloseWindow();

Windowed:
Screenshot_2024-02-02_14:19

Full-screen:
Screenshot_2024-02-02_14:19-1

GetIO().FontDefault property missing setter.

This is the format I identified for loading and changing a font:

var fontPtr = ImGui.GetIO().Fonts.AddFontFromFileTTF(@"path/to/font.ttf", 48f);
rlImGui.ReloadFonts();
unsafe {
    ImGui.GetIO().NativePtr->FontDefault = fontPtr.NativePtr;
}

Based on the Dear Imgui Demo

However, rlImGui-cs doesn't have the property setter on ImGuiIOPtr

Is there a cleaner way or can we add this to the README?

Crash on latest version

Hi, I'm using the latest versions of everything from nuget, these are the dependencies:

  <ItemGroup>
    <PackageReference Include="ImGui.NET" Version="1.90.0.1" />
    <PackageReference Include="Raylib-cs" Version="5.0.0" />
    <PackageReference Include="rlImgui-cs" Version="2.0.0" />
  </ItemGroup>

When running the simple demo program from the repo, i get this error:

Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ImGuiNET.RangeAccessor`1.get_Item(Int32 index)
   at rlImGui_cs.rlImGui.FrameEvents()
   at rlImGui_cs.rlImGui.Begin(Single dt)
   at Program.Main() in Program.cs:line 29

I changed the version of ImGuiNET to 1.89.9.3 which nuget states as minimum required version and everything works.

Thanks a lot!

Missing text and box when maximizing window + fullscreen

Problem:
When using rlImGui and using Raylib.MaximizeWindow(); and Raylib.ToggleFullscreen(); there are some text missing in imgui.

Setup:

rlImGui.Setup();
public override void Draw()
    {
        rlImGui.Begin();
        ImGui.ShowDemoWindow();
        rlImGui.End();
    }

public override void Update()
    {
        if (Raylib.IsKeyPressed(KeyboardKey.KEY_F11))
        {
           Raylib.MaximizeWindow();
           Raylib.ToggleFullscreen();
        }
    }

Showcase:

rider64_6AQQKnPzWc.mp4

Note:
This does not happen when only using Raylib.ToggleFullscreen(); so it's an issue related when using fullscreen in a window that is maximized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.