Old 03-02-2024, 04:29 PM   #1161
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Thanks. Seems like it's this issue specifically with Intel: https://github.com/ocornut/imgui/issues/3033. Feel free to add your input there.

I'll try on an old laptop with an Intel iGPU running Linux later just in case it happens there too. If it's exclusive to Intel+Windows I don't think I can investigate further.

Last edited by cfillion; 03-02-2024 at 04:43 PM.
cfillion is offline   Reply With Quote
Old 03-02-2024, 07:49 PM   #1162
b2001
Human being with feelings
 
Join Date: Nov 2006
Location: Washington
Posts: 671
Default

Thanks so much for your help. I’ll look into adding comment there…
b2001 is online now   Reply With Quote
Old 03-03-2024, 10:26 PM   #1163
b2001
Human being with feelings
 
Join Date: Nov 2006
Location: Washington
Posts: 671
Default

A couple of observations:

The issue is also occuring with the reaimgui demo on the front panel without going anywhere else in the script.

I installed the mesa 64 bit opengl32.dll in the reaper directory and i am not seeing the issue anymore. Will need to further test. It is slower than hardware rendering as you say. I am not noticing it except when i use the mouse to drag the window around. I will need to compare it to original to see how much slower, its not bad…

Last edited by b2001; 03-03-2024 at 10:40 PM.
b2001 is online now   Reply With Quote
Old 03-04-2024, 06:50 AM   #1164
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 293
Default

Hi Christian,

I'm tracking down an issue linked to cached images and the garbage collector with ImGui. Here's a test script that shows the problem on my installation (MacOS 13.6.3) :

Code:
local one = "\z
\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z
\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\x55\x49\x44\x41\x54\x38\x8D\xED\xD4\xC1\x09\x80\x40\x10\x43\xD1\x8C\xD8\x42\xFA\x2F\xF0\x17\z
\x31\x5E\xF4\x28\x06\x1C\x10\x64\x7F\x01\x8F\x30\x2C\x5B\xDD\xAD\xC9\xB6\x51\xED\x53\x10\x88\x6E\x13\x81\x29\x16\x81\x40\xDB\xAE\x11\xF0\x5C\x56\x40\xEA\x3D\x2E\z
\x8C\x97\xA5\xA0\x24\xC9\x76\x0C\xEE\x53\xD0\xD5\x8F\x1E\xF6\x02\x6F\xAB\xF5\x1F\xBE\xEE\x00\x55\x4F\x18\xA4\xBF\x78\x22\x13\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\z
\x42\x60\x82"
;

local two = "\z
\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z
\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\x67\x49\x44\x41\x54\x38\x8D\xE5\x94\x41\x0A\xC0\x30\x08\x04\xB5\xF4\x0B\xFE\xFF\x7F\xEE\x23\z
\xB6\x97\x16\x7A\x50\x12\xC1\x86\x40\x07\x72\x89\x32\x41\xC5\x28\x49\xE9\xE4\x68\xB5\x7D\x21\x3C\xA3\x4B\x00\xC3\x3E\x98\x99\x4E\x0B\x45\x24\x4C\x7E\x91\x3E\xD8\z
\x5E\xB2\x90\x2C\x1F\x77\x67\x16\xDB\x67\x28\x25\xE1\xCD\x68\x30\x21\x6B\x4A\x7E\x30\xB3\xB2\x70\xFF\xD5\x5B\xDA\x43\x02\x48\x83\xD9\x2E\xEB\xFF\xFE\xC3\x76\xE1\z
\x05\x57\x28\x4F\xAF\x1C\x55\xAA\x0E\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\x42\x60\x82"
;

local three = "\z
\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8D\x89\x1D\x0D\x00\x00\x00\x09\x70\x48\x59\z
\x73\x00\x00\x0B\x13\x00\x00\x0B\x13\x01\x00\x9A\x9C\x18\x00\x00\x00\x67\x49\x44\x41\x54\x38\x8D\xE5\x94\xDD\x09\xC0\x30\x08\x84\xB5\x74\x85\xDB\x7F\x3F\x1D\xE2\z
\x3A\x40\x2F\x69\x10\x03\xA5\x3D\xF0\x45\xE5\xF3\x2F\xC4\x49\x5A\xA7\x8E\x56\xDA\x0E\xE0\xA9\x9C\x99\xB9\xB4\x07\x00\xBE\x04\x34\xB3\x5B\xA2\x90\x2C\xDA\x3E\xB2\z
\x91\x2C\x59\x44\x50\xF9\x3F\x7E\x65\xA5\x51\x87\x3E\x33\xF5\x5C\x9E\x80\x53\x65\xE6\x30\x26\x47\x06\x50\x06\x96\x3A\x9C\x15\x7C\xFF\x95\xFD\x7F\xFF\x61\x3B\xF0\z
\x02\xBF\xF7\x55\x75\xEA\x95\x5B\x32\x00\x00\x00\x00\x49\x45\x4E\x44\xAE\x42\x60\x82"
;

local images = { 
  { name = "One",   bin = one   },
  { name = "Two",   bin = two   },
  { name = "Three", bin = three },
}

local ctx          = reaper.ImGui_CreateContext('Img Bug');
local imc          = 1
local last_change  = reaper.time_precise()
local start_at     = reaper.time_precise()
local pace         = 1.0


function getOrLoadImage(idx)
  if (not images[idx].cache) or (not reaper.ImGui_ValidatePtr(images[idx].cache, 'ImGui_Image*')) then
    images[idx].cache           = reaper.ImGui_CreateImageFromMem(images[idx].bin)
    images[idx].cache_miss      = true
    images[idx].last_cache_miss = reaper.time_precise()
    --reaper.ImGui_Attach(ctx, images[idx].cache)
  else
    images[idx].cache_miss = false
  end
  
  return images[idx]
end

function main_loop()

  local flags   = reaper.ImGui_WindowFlags_NoDocking() |
    reaper.ImGui_WindowFlags_NoCollapse() |
    reaper.ImGui_WindowFlags_AlwaysAutoResize() |
    reaper.ImGui_WindowFlags_TopMost();

  local visible, open = reaper.ImGui_Begin(ctx, 'Bug test', true, flags);

  if visible then
    
    if reaper.time_precise() - pace > last_change then
      imc = imc + 1
      if imc > #images then
        imc = 1
      end
      last_change = reaper.time_precise()
    end
    
    local img = getOrLoadImage(imc)
    
    reaper.ImGui_Image(ctx, img.cache, 20, 20)
    reaper.ImGui_SameLine(ctx);
    reaper.ImGui_Text(ctx, "This should show " .. imc);
    reaper.ImGui_TextColored(ctx, 0xFFCCCCFF, "Last cache miss " .. (img.last_cache_miss - start_at));
    
    reaper.ImGui_End(ctx);
  end
 

  if open then
    reaper.defer(main_loop)
  end
end

reaper.defer(main_loop);
The script rolls over three images. When it needs one, it either loads it or takes it from cache. Only one image is shown at a time.

We see that the garbage collector is doing its job, because the cache miss is incremented at each reapparition so the image was freed during the last round.

But sometimes (maybe once on ten), the wrong image is shown, and is it due to the fact that the pointer test is OK, but the underlying image seems to have been freed (or changed). So maybe the pointer is not ok, or maybe, more funny, the same pointer has been reused for a new image ... and we get a swap ? That would be my strongest hypothesis.

See :



The problem can be circumvented by using reaper.ImGui_Attach, but I wanted to have your opinion on this.

Ben

Last edited by Talagan; 03-04-2024 at 11:04 AM.
Talagan is offline   Reply With Quote
Old 03-04-2024, 07:52 PM   #1165
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by Talagan View Post
the same pointer has been reused for a new image ... and we get a swap ? That would be my strongest hypothesis.
Exactly.

Code:
image1 = 0xA
image2 = 0xB
image3 = 0xC
  • display image1, image2&3 get destroyed
  • display image2: 0xB invalid, CreateImage returns 0xC by chance
  • display image3: 0xC is valid, but it's image2!
cfillion is offline   Reply With Quote
Old 03-05-2024, 01:52 AM   #1166
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 293
Default

Ok, thanks for confirming ! It was a bit tricky since it does not follow the usual behaviour of the GC for script languages (that do the cleanup when the retain count on a object falls to 0, but here you have to handle the retain count by yourself with Attach or Detach), but once you know how it works, it's ok. To summarize, if one plans to hide images, he/she should attach them when caching them or he/she'll get random behaviours.
Talagan is offline   Reply With Quote
Old 03-05-2024, 02:30 AM   #1167
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by Talagan View Post
that do the cleanup when the retain count on a object falls to 0
Yeah, I wish that was possible (eg. like reaper.arrays). "Use it or lose it" is the best an extension can do.

Have you considered creating an icon font for your script? Vector so it scales + only one thing to attach.
cfillion is offline   Reply With Quote
Old 03-05-2024, 02:45 AM   #1168
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 293
Default

Yes, during development I've fallen on that cool project :

https://github.com/juliettef/IconFontCppHeaders

for another reason, I was looking for a way to mix icons and texts. ImGui does not offer yet a kind of rich text / simple markup with italic, bold and colors - but we can live without it, since it's already so cool.

Maybe too much work atm to create a vector font since I have a lot to do on the core features which are prior, but mabye later, during the final touch !
Talagan is offline   Reply With Quote
Old 03-05-2024, 02:56 AM   #1169
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by Talagan View Post
ImGui does not offer yet a kind of rich text / simple markup with italic, bold and colors


Code:
local normal = reaper.ImGui_CreateFont('sans-serif', 13)
local bold = reaper.ImGui_CreateFont('sans-serif', 13, reaper.ImGui_FontFlags_Bold())

local TEXT_COMMANDS = {
  f = function(ctx, arg)
    local fontmap = {
      n = normal,
      b = bold,
    }
    reaper.ImGui_PushFont(ctx, fontmap[arg])
  end,
  F = function(ctx)
    reaper.ImGui_PopFont(ctx)
  end,
  c = function(ctx, arg)
    reaper.ImGui_PushStyleColor(ctx, reaper.ImGui_Col_Text(), tonumber(arg, 16))
  end,
  C = function(ctx)
    reaper.ImGui_PopStyleColor(ctx)
  end,
  ['-'] = function(ctx)
    reaper.ImGui_Bullet(ctx)
  end,
}

local function richText(ctx, text)
  text:gsub('[^\n]+', function(line)
    local concat = false
    line:gsub('\0?[^\0]+', function(chunk)
      if chunk:sub(1, 1) == '\0' then
        local eoc = chunk:find(';', 3)
        local cmd = chunk:sub(2, 2)
        local arg = chunk:sub(3, eoc - 1)
        TEXT_COMMANDS[cmd](ctx, arg)
        chunk = chunk:sub(eoc + 1)
      end
      if concat then
        reaper.ImGui_SameLine(ctx, nil, 0)
      else
        concat = true
      end
      reaper.ImGui_Text(ctx, chunk)
    end)
  end)
end

local ctx = reaper.ImGui_CreateContext('My script')
reaper.ImGui_Attach(ctx, normal)
reaper.ImGui_Attach(ctx, bold)
local function loop()
  reaper.ImGui_PushFont(ctx, normal)
  richText(ctx, "\0-; Hello \0cFF0000FF;red->\0fb;bold\0C;\n\z
                 \0-; Wo\0F;rld \0cFFFF00FF;yellow->\0fb;bold\0F;\0C;")
  reaper.ImGui_PopFont(ctx)
  reaper.defer(loop)
end
reaper.defer(loop)
cfillion is offline   Reply With Quote
Old 03-05-2024, 03:12 AM   #1170
Talagan
Human being with feelings
 
Join Date: Feb 2016
Location: Paris / France
Posts: 293
Default

Awesome compact version, thanks ! And I've just realized that, contrary of with the JSFXs, fonts can be loaded from local files. This is amazing, since we don't have to rely on the user's OS.
Talagan is offline   Reply With Quote
Old 03-06-2024, 07:29 PM   #1171
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 463
Default

Hi cfillion, I just stumbled into an issue with text inputs:



After pressing enter in a focused text input, all text inputs seem to stop accepting input.
It looks like they lose focus after a single frame. When I bash my keyboard some of the letters pass through

The gif is made using ImGui standard demo, REAPER 7.11, ReaImGui v0.8.7.6 on macOS

Thanks!
souk21 is online now   Reply With Quote
Old 03-06-2024, 09:24 PM   #1172
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Strange. It works here (7.11/macOS 10.14), does it happens in a fresh portable install? Tools > Debug Log might have some clues.
cfillion is offline   Reply With Quote
Old 03-07-2024, 04:39 AM   #1173
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 463
Default

Quote:
Originally Posted by cfillion View Post
Strange. It works here (7.11/macOS 10.14), does it happens in a fresh portable install? Tools > Debug Log might have some clues.
Thanks for the quick answer! I found the culprit
I have Enter bound to "Transport: Go to start of project" as a global shortcut. If I remove the shortcut (or set its scope to "Normal") it works correctly.



It's hard to see in the gif but here what is printed when the shortcut is not global (i.e when everything works)

Code:
[03694] [io] Processed: Key "Enter" Down
[03694] SetActiveID() old:0x258B0D0A (window "Dear ImGui Demo") -> new:0x00000000 (window "")
[03695] [io] Calling io.SetPlatformImeDataFn(): WantVisible: 0, InputPos (207.00,477.00)
[03697] [io] Processed: Key "Enter" Up
And here's what is printed when shortcut is global

Code:
[00654] [io] Processed: Key "Enter" Down
[00654] SetActiveID() old:0x258B0D0A (window "Dear ImGui Demo") -> new:0x00000000 (window "")
[00655] [io] Calling io.SetPlatformImeDataFn(): WantVisible: 0, InputPos (72.00,345.00)
Maybe something with not catching the key up ?

Note that focusing to REAPER and back to the demo fixes the issue as well.
souk21 is online now   Reply With Quote
Old 03-08-2024, 03:58 PM   #1174
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by souk21 View Post
I have Enter bound to "Transport: Go to start of project" as a global shortcut. If I remove the shortcut (or set its scope to "Normal") it works correctly.
[...]
Maybe something with not catching the key up ?

Note that focusing to REAPER and back to the demo fixes the issue as well.
Great find, thanks! Not sure how to best fix it though. The issue is that 1) ReaImGui captures global shortcut events while a text input is active 2) Pressing Enter de-activates the text input = capture is released 3) By the time the key up arrives REAPER gets it not ReaImGui, so the key gets stuck (until something else clears it, like window losing focus).

Mmh maybe I could latch SetNextFrameWantCaptureKeyboard to true until all keys are released and live with the side effects of that...

It could also be considered a REAPER bug, that key ups don't reuse the same capture state of their corresponding key down (REAPER just re-asks the focused window whether it's in a text field then routes the event accordingly).

Last edited by cfillion; 03-08-2024 at 04:15 PM.
cfillion is offline   Reply With Quote
Old 03-09-2024, 04:15 AM   #1175
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 463
Default

Quote:
Originally Posted by cfillion View Post
Great find, thanks! Not sure how to best fix it though. The issue is that 1) ReaImGui captures global shortcut events while a text input is active 2) Pressing Enter de-activates the text input = capture is released 3) By the time the key up arrives REAPER gets it not ReaImGui, so the key gets stuck (until something else clears it, like window losing focus).

Mmh maybe I could latch SetNextFrameWantCaptureKeyboard to true until all keys are released and live with the side effects of that...

It could also be considered a REAPER bug, that key ups don't reuse the same capture state of their corresponding key down (REAPER just re-asks the focused window whether it's in a text field then routes the event accordingly).
I see. To be fair it does sound like a REAPER bug
souk21 is online now   Reply With Quote
Old 03-10-2024, 04:50 AM   #1176
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Hi cfillion,

I have some graphic issues/black screen, affecting all the ReaImGui scripts interface :



My configuration:

Mac Os 10.9.5 (can't use metal option for graphic)
OpenGL 3.2
Reaper 7.11
And the last reapack Update

I'm sorry, i don't remember when the issue started but it worked before with some scripts.
I try to downgrade ReaImGui and the scripts,but doesn't change the issue.

Someone else have this issue ?

Thanks and kind regards
Damien
chronoflex is offline   Reply With Quote
Old 03-10-2024, 05:23 AM   #1177
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by chronoflex View Post
I'm sorry, i don't remember when the issue started but it worked before with some scripts.
I try to downgrade ReaImGui and the scripts,but doesn't change the issue.
It would be very helpful if you could find which version broke it. Downgrading to each major 0.X release, restarting REAPER then testing ReaImGui_Demo.lua. Then narrowing down to the exact 0.X.Y.Z that broke it.

Quote:
Originally Posted by chronoflex View Post
Mac Os 10.9.5
OpenGL 3.2
What's the GPU model?
cfillion is offline   Reply With Quote
Old 03-11-2024, 04:16 AM   #1178
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Quote:
Originally Posted by cfillion View Post
It would be very helpful if you could find which version broke it. Downgrading to each major 0.X release, restarting REAPER then testing ReaImGui_Demo.lua. Then narrowing down to the exact 0.X.Y.Z that broke it.



What's the GPU model?
Thanks, I forgot to mention it,

I found the issue start at version 0.7 with ReaImGui_Demo.lua and ReaImGui_Hello World.eel, i check also other reaImGui-script that support this version.

my configuration :
Graphisme Intel HD Graphics 4000 1024 Mo
On mac mini mid-2011 (i7 2.3Ghz 4GGB RAM)

I found this on Apple support :
Mac mini (Mid 2011)
Intel HD 3000
OpenGl 3.3
(a bit old, maybe too old? OSX 10.9.5 is very stable with my old firewire audio card )

I try to check for OpenGl versions on OSX but i didn't find a way to check with commande lines.
I saw a way to update OpenGl to 4.1 with Xcode but it seems not easy for my poor knowledge of OSX. I also want to check if i mess up something in the instalation of reaper's scripts.

Thanks for your answer,
Damien
chronoflex is offline   Reply With Quote
Old 03-11-2024, 04:27 AM   #1179
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Thanks. The only relevant change between v0.6.2 and v0.7 was the implementation of transparency. If you drag the very top/center area of a black window over a REAPER docker (eg. docked mixer), does something non-100% black show up?

EDIT: The above with the latest version of ReaImGui as drag-docking is a relatively recent feature.
cfillion is offline   Reply With Quote
Old 03-11-2024, 03:09 PM   #1180
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Quote:
Originally Posted by cfillion View Post
Thanks. The only relevant change between v0.6.2 and v0.7 was the implementation of transparency. If you drag the very top/center area of a black window over a REAPER docker (eg. docked mixer), does something non-100% black show up?

EDIT: The above with the latest version of ReaImGui as drag-docking is a relatively recent feature.
Ok interesting, maybe the transparency can affect the window screen ?

I tried to dock the black window and get this (with the last update of ReaImGui) :



i can't dock the window and it look like the blues spot to guide the window don't show up.
I will try more test to find clues.

Thanks
chronoflex is offline   Reply With Quote
Old 03-12-2024, 12:09 AM   #1181
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by chronoflex View Post
I tried to dock the black window and get this (with the last update of ReaImGui) :
Can you give this build a try? https://ci.appveyor.com/api/buildjob...i-x86_64.dylib

Tried a few things in it. It should either fix it, or show an error message so I can figure out what is failing on your PC.
cfillion is offline   Reply With Quote
Old 03-12-2024, 09:08 AM   #1182
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Quote:
Originally Posted by cfillion View Post
Can you give this build a try? https://ci.appveyor.com/api/buildjob...i-x86_64.dylib

Tried a few things in it. It should either fix it, or show an error message so I can figure out what is failing on your PC.

thanks a lot;

I tried with ReaImGui demo

the reascript window says :

.../REAPER/Scripts/ReaTeam Extensions/API/ReaImGui_Demo.lua:299: ImGui_Viewport_GetWorkPos: expected a valid ImGui_Viewport*, got 0x61804d5ab2a0

and i also have the window ReaImGui Backend error says :

OpenGL errors at line 271: 1286

Damien
chronoflex is offline   Reply With Quote
Old 03-13-2024, 07:55 AM   #1183
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by chronoflex View Post
OpenGL errors at line 271: 1286
https://ci.appveyor.com/api/buildjob...i-x86_64.dylib
cfillion is offline   Reply With Quote
Old 03-14-2024, 06:53 AM   #1184
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Quote:
Originally Posted by cfillion View Post
Ok tkanks for your time ! I test your last build.

The reaImGui demo window seems back to normal :



I can dock the window.

the script stop after touch on values.

the script's error message :

.../REAPER/Scripts/ReaTeam Extensions/API/ReaImGui_Demo.lua:6416: ImGui_Combo: items must be null-terminated

And the reaImGui error message :

(g.CurrentWindowStack.Size == 1) && "Mismatched Begin/BeginChild vs End/EndChild calls: did you forget to call End/EndChild?"

I can't open other reaImGui script (it not the purpose of this build i suppose ?)

I can do more test if it can help

Damien
chronoflex is offline   Reply With Quote
Old 03-14-2024, 07:11 AM   #1185
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Great! The fix will be released in 0.9 (it's too much for a 0.8.x, accommodating macOS 10.9 not doing its part of initializing the framebuffer required rewriting the macOS OpenGL code almost entirely...).

Quote:
Originally Posted by chronoflex View Post
.../REAPER/Scripts/ReaTeam Extensions/API/ReaImGui_Demo.lua:6416: ImGui_Combo: items must be null-terminated
The demo script you have is from an older version (probably from downgrading earlier).
  1. Install v0.8.7.6 using ReaPack to bring all files up-to-date
  2. Replace the .dylib in UserPlugins with the build above
  3. Replace Scripts/ReaTeam Extensions/API/imgui.lua with this version: imgui.lua
...then you should be good to go with any public script out there.
cfillion is offline   Reply With Quote
Old 03-15-2024, 05:35 AM   #1186
chronoflex
Human being with feelings
 
Join Date: Feb 2016
Posts: 7
Default

Awesome, All the scripts i tried work like a charm.

Quote:
Originally Posted by cfillion View Post
Great! The fix will be released in 0.9 (it's too much for a 0.8.x, accommodating macOS 10.9 not doing its part of initializing the framebuffer required rewriting the macOS OpenGL code almost entirely...)
thank you so much for all this work.

I don't know if they are lot of old OSX version users, i can understand if it's not possible to maintain retro compatibility.
With the lack of support of apple for OpenGL it's totaly understandable.

Damien
chronoflex is offline   Reply With Quote
Old 03-21-2024, 01:03 PM   #1187
b2001
Human being with feelings
 
Join Date: Nov 2006
Location: Washington
Posts: 671
Default Trying to understand graphics/widget placement

I reference all my draw lines and draw text, etc. and everything is preserved as I move the window around with the left mouse button held down and drag around…
(Getcursorscreenposition)
If i don’t do this, the window moves around when dragging but the graphics does not.

I have the widgets placed with “hard coded” coordinates, yet they also drag around.
(Setcursorposition)

Everything is working ok, but i want to do something different within the graphics window; instead of moving the entire window around, just scrolling the graphics backwards or forwards on the x axis.

So far anything i try, is not working. Looking for a simple example. I have so much code that its difficult to provide a snippet…
b2001 is online now   Reply With Quote
Old 03-22-2024, 12:08 AM   #1188
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

DrawList API uses global ("screen") coordinates whereas items use window-local coordinates.

Quote:
Originally Posted by b2001 View Post
Everything is working ok, but i want to do something different within the graphics window; instead of moving the entire window around, just scrolling the graphics backwards or forwards on the x axis.
Not sure I understand what you mean. A regular ImGui window has scrolling built-in. See BeginChild for adding a sub-scrolling area within a bigger window.
cfillion is offline   Reply With Quote
Old 03-22-2024, 10:25 AM   #1189
b2001
Human being with feelings
 
Join Date: Nov 2006
Location: Washington
Posts: 671
Default

I have attached a picture to help better explain what I am asking.

I am trying to figure out the best user experience for both Scrolling and Zooming. It is further complicated by two Y Axis, Frequency on the left and Magnitude on the right. I can figure that out once I better understand best options/practices with ReaImGui.

I do not have it working, but could complete the vertical and horizontal sliders to control the drawline redraw.

As I said, I currently have the drawlist coordinates tied to the cursor so that the entire screen moves when I mouse drag, which I want.

What I envisioned was using the sliders for horizontal/vertical zooming in and out and within the drawlist window using mouse dragging back and forth or up and down to control horizontal/vertical scrolling- yet still retain dragging the entire window around if the mouse cursor dragging starts at a point outside the drawlist window yet still within the ReaImGui window. This might not be possible while still retaining the ability to drag entire window around; and if so, either I use radio buttons to control whether the sliders zoom or scroll or I use more sliders, some for zoom, others for scroll.

Any attempts I have made on this either breaks the drawlist graphics on the screen when dragging the ReaImGui window around, or does not appear to work maybe because it is occurring for only 1 defer cycle.

I tried child windows but I am running into the same issues; which mostly might be due to me not completely understanding how to leverage child windows.

Any general advice would be appreciated. I will continue to explore child windows.
Attached Images
File Type: jpg ReImGuiPicture.jpg (150.2 KB, 10 views)
b2001 is online now   Reply With Quote
Old 03-22-2024, 10:47 AM   #1190
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by b2001 View Post
What I envisioned was using the sliders for horizontal/vertical zooming in and out and within the drawlist window using mouse dragging back and forth or up and down to control horizontal/vertical scrolling- yet still retain dragging the entire window around if the mouse cursor dragging starts at a point outside the drawlist window yet still within the ReaImGui window. This might not be possible while still retaining the ability to drag entire window around; and if so, either I use radio buttons to control whether the sliders zoom or scroll or I use more sliders, some for zoom, others for scroll.
Use InvisibleButton() over the area where dragging shouldn't move the window. (Or ConfigVar_WindowsMoveFromTitleBarOnly if that area is the entire window.)
cfillion is offline   Reply With Quote
Old 03-22-2024, 10:56 AM   #1191
b2001
Human being with feelings
 
Join Date: Nov 2006
Location: Washington
Posts: 671
Default

Ok thanks so much. Will look into those…
b2001 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.