Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AgkSharp for Windows - General Questions And Feedback

Author
Message
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Oct 2019 13:10
@linus369:
Quote: "Also found that OpenVR has already bindings for C# (https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_api.cs). Hmmm, could this work with AGKsharp (managed/unmanaged, problems like that ...). Also not sure if this would be too low level for me - compared to the original VR module of AppGameKit ..."


I think it should work. I looked at one of the examples. The initialization of OpenVR looks simple. Since you don't have to specify a GL context there, as I saw it. I assume it pulls it from the active window that was previously created.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
13
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Oct 2019 13:59
Thanks MadBit, I found the issue in my own code (of course). It was in the creation of the object using the wrong parameter.
Your second version is certainly a neater solution but it doesn't work for me, maybe I am using an old version of the library. Does this not use memblocks? If not how are you getting the vertex data?
Using AppGameKit V2 Tier 1
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Oct 2019 16:27
In Tier 2 there are classes like cObject which give you the possibility to access the buffer more directly.
Some of these classes have been passed to AGKSharp (cObject=AGKObject, cSprite=AGKSprite, cImage=AGKImage, ...).
You are right, these classes were added in April 2019.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Nov 2019 13:49
Hi, i come with a new update.

From now on there are no more single packages for Linux, Windows and binaries. Now it's all in one package.
The directory structure in the package is self-explanatory, I think. With the update I am equal to AppGameKit version 2019.11.27. No new features have been added since the last update. TGC has only added commands for the mobile devices and for the Studio version. The Studio commands are also available in the Classic version, but they do nothing. They are empty functions.

These functions are meant.

SetObjectMeshCastShadow
SetObjectShaderConstantArrayFloatByName
SetObjectShaderConstantArrayVec2ByName
SetObjectShaderConstantArrayVec3ByName
SetObjectShaderConstantArrayVec4ByName
SetShaderErrorMode
SetShaderConstantArrayFloatByName
SetShaderConstantArrayVec2ByName
SetShaderConstantArrayVec3ByName
SetShaderConstantArrayVec4ByName
IsInvertedDepth
GetClipSpaceMode
IsTopLeftOrigin
GetDrawing3DSetupTime
MakeColor
GetColorAlpha
SetPresentMode
ForcePresent
GetAppInstalled

Download here.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
13
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Dec 2019 10:38 Edited at: 17th Dec 2019 10:41
Hi MadBit,
I am having a small issue with the standard template. When I hit escape the form seems to rescale and the window size changed (after disabling escape closes app).
Any idea what might be causing this as it's totally screwing with my functionality...?
Cheers!
EDIT: Here is what I am working on BTW
Using AppGameKit V2 Tier 1

Attachments

Login to view attachments
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Dec 2019 13:57
Sorry, I can't reproduce the error. When I use the standard project everything works with the escape key as it should.
Do you notice the same behavior when you compile and execute the default template as it is?
Do you query the escape key to trigger certain events yourself?
Which AGKSharp version do you use?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
13
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Dec 2019 09:39
Hi MadBit,
It's definitely something to do with scaling as my machine is on 125% scaling and if I go to 100% the problem goes away.
I am not using the escapekey in any way and have removed any possible reference to it.
If I remark out these two lines from Core.cs it happens in the template:

Can you try on 125% and see what happens?
Using AppGameKit V2 Tier 1
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 18th Dec 2019 20:16
You're right. You're right. If I try it under windows 10 with 125% zoom, the window will scale down. That with every key you press.

I've been able to track the issue down to a function in Core.PassKeyDown.
If I comment out all lines that call the function System.Windows.Input.Keyboard.IsKeyDown. The problem does not occur any more.
The strange thing is that this function does not even have to be executed. It is enough if the function is present, and the window already scaled down again.
The same applies to the KeyUp function.
But I don't know how to fix it, because it is a system function. The function is also important to differentiate between right and left shift-/ctrl and alt key.

Any suggestions?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Dec 2019 20:40 Edited at: 18th Dec 2019 21:05
I wonder if it has something to do with when you initialize/install the keyboard handler (Before you set the window size)

Is it this?

or possibly use the AppGameKit methods to read the keyboard
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 19th Dec 2019 07:20 Edited at: 19th Dec 2019 07:22
@blink0k
That's exactly the problem. Thank you. It looks like it's a known problem.
Unfortunately I did not find a fix for it.

The AppGamekit function to query the keyboard needs this C# function to work at all. In Core.cs all keyboard and mouse inputs are passed to AppGameKit. So that the queries about e.g. GetRawKeyState work at all.

@baxslash
I have now fixed this bug by importing another c++ function. And work with it. In the next update the templates will be corrected. For the moment, you can also change the code snippets yourself.

In Core.cs on top of the other PInvokes


And change the Methods PassKeyDown and PassKeyUp


I hope it helps and there are no unexpected problems with that.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Dec 2019 08:05 Edited at: 22nd Dec 2019 08:07
Okay, and here's the last update for this year.

LOG:
Equal to AppGameKit Classic Version 2019.12.16
Some features are not available under AppGameKit Cassic and AgkSharp and are only available in the Studio version.

FIX - On windows computers, pressing a key caused the window to be rescaled when the surface was enlarged.

Download site




I wish you all a merry christmas and a happy new year.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
13
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Jan 2020 09:41 Edited at: 8th Jan 2020 09:46
Thanks MadBit, I haven't logged in here for a while so just seen this. I think I will test the update with my project and see if it fixes it. I went to 100% scaling temporarily and may stick to it now if it doesn't strain my eyes too much. My project is coming along nicely and I will be sharing a WIP thread soon for some feedback.

EDIT: I made those changes in the Core.cs file and it is now working fine thank you!
Using AppGameKit V2 Tier 1
OriginalKronos
2
Years of Service
User Offline
Joined: 10th Nov 2017
Location:
Posted: 11th Feb 2020 20:35
Hi, I think there may be a memory leak problem with the following commands:

Agk.GetMeshMemblockVertexRed
Agk.GetMeshMemblockVertexGreen
Agk.GetMeshMemblockVertexBlue
Agk.GetMeshMemblockVertexAlpha

I am using these to query a mesh memblock and write out the colours to a text file. However every time I run the save, the memory usage increases substantially. After going through and eliminating all the other commands I found the above were the issue.
I have worked around this by querying the memblock with Agk.GetMemblockByte instead but I figured I would let you know.
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Feb 2020 17:00
Thank you for pointing that out.
I looked at the lines in the code. In my AgkSharp code, the function is looped through like any other.
In the AppGameKit T2 code I could not find anything about how this memory leak could occur.
Can you give me a small example where and how you retrieve the values? So I can understand it.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
OriginalKronos
2
Years of Service
User Offline
Joined: 10th Nov 2017
Location:
Posted: 16th Feb 2020 13:10 Edited at: 16th Feb 2020 15:31
Here is a simple example. On my machine I see memory usage steadily increasing over time.

Deleted first example in favour of this one. This may be a problem with AppGameKit itself as I see a similar memory usage increase when I run the equivalent code in appgamekit directly.

MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Feb 2020 10:02
I tested your code snippet.
Can't confirm that bug.
After two hours at a frame rate of about 3000 fps the memory consumption did not increase.
I have no idea why you have a memory leak.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 27th Apr 2020 22:38
I know this is not really part of AGK... but...

Is there anyway for you to add in a different, better kind of editbox?

This being only for windows, the current editbox box is just so bad...

Maybe extra function for AGK-Sharp.
Perhaps it's build in form?
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 30th Apr 2020 11:53
if you have started an Agk-Sharp Forms project then you can use the editbox of Forms
I don't know if this is what you need. Agk-Sharp runs on a separate panel. Creating an editbox next to the panel will not be a problem, but in the panel and adding it to your Agk graphic design will be difficult.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 5th May 2020 15:31 Edited at: 5th May 2020 15:39
I mean a good editbox box like those in unity and epic...
there is no copy, no mouse/pointer select, no paste.
Some of those could be custom programmed, but it just s*ck out of the box.

Also, I do not know if this is a bug, but after copying over the new DLL, the following function no longer work when wider than the current screen.
Such as setviewport from 0,0 than the current virtualresolution.
Such as 19550,108550 instead of 0,0;

Agk.GetSpriteHitTest(bID, Agk.ScreenToWorldX(Agk.GetPointerX()), Agk.ScreenToWorldY(Agk.GetPointerY()));

Everything end up breaking...
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th May 2020 05:02
What exactly do you mean by setviewport such a command does not exist.
I have done some short tests with SetViewOffset which works fine so far.

Do you have a code snippet for me?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 7th May 2020 21:54
I mean Agk.GetSpriteHitTest no longer work after using SetViewOffset() after copying the new dll, nothing was change in code...

I just came from unity that time...
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 7th May 2020 22:07
Did you copy AgkSharp.dll and Wrapper.dll?
Did you also recompile the project again?
Which version was the old one? And to which version did you update.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Qugurun
Valued Member
5
Years of Service
User Offline
Joined: 8th Dec 2014
Location: Tyumen, Russia
Posted: 7th May 2020 22:46 Edited at: 7th May 2020 23:36
Chmava
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 8th May 2020 02:37
a few post up, that is exactly what I did Qugurun...
bID is the sprite id itself, no code was change, only the dll version.

Yes I copy both dll.

I am not sure which version, but the dll was complied on 24 feb 2019.
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 8th May 2020 06:08 Edited at: 8th May 2020 06:11
@all: New version to match AppGameKit 2020.04.30 is available.

Download here





@Chmava:
I've tested it now. I have taken a project template from Feb 24, 2019 and compiled it with this code.



It's working!
Now I have copied both dll's from version Dec 22, 2019 over the old ones.
Also works!
Project recompiled and started - works too.

I don't know why you have these problems.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 9th May 2020 11:42 Edited at: 9th May 2020 15:23
This is why I mention I am not sure if it is a bug, anyway, could you try the following code?


If that is not it, then perhaps I just need the full of the new complied...
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th May 2020 05:16
I tested it the same way.

No difference. It's working!
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 11th May 2020 08:48 Edited at: 11th May 2020 10:01
is there any changes from that old dll to this new one?

Like major changes...?
MadBit
Valued Member
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th May 2020 10:54
These are the changes since Feb. 24, 2019. These are the changes that were made specifically for AgkSharp.
Furthermore, each update will only update to the current AppGameKit - Classic version.


Quote: "FIX - Keycodes of Numpad (Mul, Div, Min, Add, Dec) corected
ADD - AgkNode class.
ADD - AgkShader class.
ADD - AgkMesh class.
ADD - AgkObject3D class.
ADD - Math.Wrap(min, max, val) Function.
ADD - Constructor AgkImage(File, ScaleX, ScaleY) to load a rescaled image. (mentioned by Kyle873)
ADD - Agk.SetSpriteShape(SpriteID, ESpritePhysicsShape) to set the Sprite shape. (mentioned by Kyle873)
ADD - Agk.SpriteSetShape(ESpritePhysicsShape, ShapeID) to set the sprite shape via Sprite class. (mentioned by Kyle873)
ADD - Agk.PlayMusicOGG(MusicID, bool) overloaded. (mentioned by Kyle873)
ADD - Agk.SetDefaultMinFilter(EMinMagFilter) / Agk.SetDefaultMagFilter(EMinMagFilter) overloaded. (mentioned by Kyle873)
ADD - Agk.IsSpriteInScreen(SpriteID) created to check is a sprite in screen. (mentioned by Kyle873)
ADD - SetSpriteShape(SpriteID, ESpritePhysicsShape, ShapeID) to create physics shapes on Sprites. (mentioned by Kyle873)
ADD - AgkFont Class. To load fonts. (mentioned by Kyle873)
ADD - SetFont(AgkFont) for AgkText to set custom font. (mentioned by Kyle873)

FIX - AgkSprite.SetColor can't set other alpha value.
ADD - Math.SmoothStep(t0, t1, t)
ADD - Math.SmoothStepInv(t0, t1, t) the inverse of Math.SmoothStep
ADD - AgkText.GetWidth(start, length) get the pixel width between start and start+length chars.
ADD - AgkText.String property.
"
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2020-07-13 13:12:21
Your offset time is: 2020-07-13 13:12:21