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
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Apr 2019 09:06
Thanks for testing MadBit, I ended up coming up with a better method (if a little slower) of improving my gfx.
I have a feeling I may have been using a full path for the filename rather than a relative path. This might have been the cause but I was getting a valid uint returned for the shader ID.
Anyway the software is really coming on now. I would love to show you a video (maybe in a PM) so you can see what I've been working on.
Maybe once I have the exported data importing properly into our main software I will create an end to end demo.
Using AppGameKit V2 Tier 1
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Apr 2019 10:07
I would like to see what you've achieved with AgkSharp.
Something like that motivates me.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Apr 2019 11:58
Sent you a PM
Using AppGameKit V2 Tier 1
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Apr 2019 13:49
Thank you.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
10
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Apr 2019 10:10 Edited at: 20th Apr 2019 10:14
Agk.SetTextFont does not work.
Not sure if it is Agk.LoadFont() or just that.

The same code work in tier 1.

Could you check it out?

Agk.LoadFont(1, "/media/font/ARIALUNI.TTF");
Agk.CreateEditBox(1);
Agk.SetEditBoxPosition(1, 500f, 500f);
Agk.SetEditBoxFont(1, 1);
Agk.SetEditBoxText(1, "包要干什么");

Attachments

Login to view attachments
Chmava
10
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 22nd Apr 2019 02:38
bump?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Apr 2019 07:23
I'm sorry. It's Easter. Much to do and celebrate with the family.

And I had to narrow down the problem first.

I figured out after several tests what's wrong. I've found that the same bug also occurs in a standard Tier2 project.
I don't know if this is an Agk bug in the core engine or not. If I encode this string by hand into the UTF-8 format it works as it should. I think it has something to do with the UTF-8 encoding in the uString class. It doesn't recognize that there is a Unicode character set and doesn't encode the characters correctly in UTF-8.
From my point of view it's not up to me to fix bugs in the core engine (if it is one).

Perhaps the following function will help you as a workaround

Then your code looks like this.


Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
10
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 23rd Apr 2019 03:20 Edited at: 23rd Apr 2019 03:50
So it is indeed a bug?

Also, getclipboard does not return any unicode, instead it just return code 63 for any unicode character while 0-9 and a-z return fine.

Could you confirm?

I end up using the default that came with windows: Clipboard.GetText();
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Apr 2019 05:45
I'm afraid it is a bug. A closer look into the source code shows me that the data from the clipboard is only processed as standard string. Without checking if it is Unicode.

Quote: "I end up using the default that came with windows: Clipboard.GetText();"

If you use AgkSharp this would be the better choice.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th May 2019 07:57
Agk.GetImageFilename(img) returns an empty string. All I am using is:
Using AppGameKit V2 Tier 1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th May 2019 12:13
Maybe this (from doco)
Quote: "This does not immediately capture the image, depending on the platform your app may continue running in the background whilst the user is choosing an image, or it may pause execution whilst the image is chosen. In any case you must assume your app continues running but is no longer visible, use IsChoosingImage to check when the user returns from the image choosing process, and GetChosenImage to discover the result of the process."
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th May 2019 11:19 Edited at: 17th May 2019 12:20
Ich denke blink0k hat recht. Ich habe das Beispiel aus der Dokumentation in AgkSharp umgesetzt, aber nicht getestet. Vielleicht hilft das weiter.


EDIT:
I've tested it now. It works like this. I also tested it without the while loop. and it works the same way.
You just have to get the selected image with GetChosenImage. But I still think it's safer if you keep the while loop.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th May 2019 15:52
Thanks guys, that would fix it alright! I already built a workaround but I'll try to remember this in future.
Using AppGameKit V2 Tier 1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th May 2019 23:37
It might be a good idea to set a state and check across sync() frames. That tight loop might churn a bit of battery (Just guessing)
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 6th Jun 2019 21:42
Did you get approval to continue on AppGameKit Studio as they allow for Python as well?
See: https://forum.thegamecreators.com/thread/221811#msg2640622
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th Jun 2019 21:57 Edited at: 6th Jun 2019 21:58
Python was greenlit to update with classic not studio. C# already had this permission and this only brought python up to par as it had fallen well behind

Quote: "
and can keep itself updated to the latest AppGameKit Classic releases."
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 7th Jun 2019 12:23 Edited at: 7th Jun 2019 13:32
Just like Ortu said. Nevertheless, at the same time as Adambiser (AGK for Phyton), I had received the message that I could continue to hold AGKSharp up to date.

Edit:
The permission is only valid for the classic version.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 8th Jun 2019 01:01
Well that's at least something. Better than nothing. Imho C# is way to popular to let go as an option.
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 22nd Jun 2019 15:55
Hi MadBit...

I have been successfully working with your AGKSharp with VS 2019, which, by the way, I finally resolved that installation issue I had written to you about earlier.

I have been able to load a hexagonal-based map-board, created with the Tiled software and started developing the scrolling mechanisms through the use of the WinForms button controls.

My question is though, how does one use the mouse to select areas on the displayed map-board in the screen area?

I have initialized my application in the same manner that you create a new Windows form, inclusive of passing the form's handle to the "Agk.Init()" function.

In addition I have been testing the "Agk.GetPointerPressed()" function but it never recognizes my mouse clicks when I select a point on the displayed map-board.

Can you tell me what I am missing here?

I have been reviewing your sample code but so far everything I have tried to mimic in my own code has not been successful...

Thank you

Steve Naidamast
Sr. Software Engineer
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Jun 2019 23:13 Edited at: 22nd Jun 2019 23:19
It doesn't recognize that you have clicked or it doesn't recognize what you have clicked on?

I'd recommend handling hardware events for mouse and keyboard, like detecting a click, with the winforms command set rather than the agk.

To get what was clicked, you will want to use agk.getSpriteHit

I've got some additional example code here that you might find helpful

https://forum.thegamecreators.com/thread/223554
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 23rd Jun 2019 00:36
Hi Ortu...

Thank you for your reply. As to your first question, the answer would be both (It doesn't recognize that you have clicked or it doesn't recognize what you have clicked on?)

And yes, I have been attempting to use the WinForms Form.MouseDown event to capture the click on the display screen. However, using the AppGameKit GetPointerPressed and GetPointerX functions, I see in both that nothing is returned to either of these functions.

I have been trying to use MadBit's sample "Terrain" project as a guide, which has the the AppGameKit GetPointerPressed and GetPointerX functions within the main "Program.cs" file.

I much prefer VB.NET to C#, though I am fluent in it, so my code snippets are in VB.NET, if you wouldn't mind taking a quick look at them...

My Program.vb



My Core.vb



My Window.vb


Thank you for your help. It is greatly appreciated...

Steve Naidamast
Sr. Software Engineer
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 23rd Jun 2019 05:27
Form_OnMouseDown / MyButton_Click: I have a feeling that the click event may be getting eaten by one of the handlers and doesn't make it through to the other. I'd start with adding some debugging output to see which of these is firing in which order.

It also looks like you are missing the mouse moved handler which passes through the mouse position info to agk:

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 23rd Jun 2019 16:58 Edited at: 23rd Jun 2019 17:58
Hi Ortu...

Thank you very much for your suggestions.

I added in a handler for the MouseMove Event and that did the trick for reporting the mouse position when the displayed map-board was selected with the mouse.

However, I notice another minor but annoying issue. It seems that it always takes two mouse clicks to have the information reported. Even when I removed the scroll button and its associated handler from the code temporarily, this issue persisted.

It was one of the first things I noticed when I started my testing but I had put it up to a conflict with the fact that for some reason at that point the mouse positional information was not being reported as I had wanted.

I know this issue is a result of something minor and I believe I ran into it when I was developing with the MonoGame Engine but for the life of me I cannot remember how I may have resolved it.

>>>

In some further testing, I deleted both the message-box and the Agk.Print statements I was using to show the X-position of the mouse position when selecting the screen and replaced them with a Debug statement to show the information in the Immediate window. Now it appears that for every single click the information is reported instead of for what would have been akin to double-clicking on the same position. As a result, at least in these circumstances the mouse-click was being interfered with both the message-box and the Agk.Print statements.

And yet in MadBit's Terrain sample project he is able to display Agk.Print statements without any issues. True, he is doing something different from what I am attempting to accomplish but I do find it somewhat odd that the Agk.Print statement would interfere with a mouse-click in this manner.

Steve Naidamast
Sr. Software Engineer
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Jun 2019 10:53
Hi, sorry about the late answer. I'm still two weeks on vacation. So I don't have a chance to give reasonable support.

The way I see it you use vb. The templates are unfortunately not on the same level as those of C#. When I'm back home I'll bring them up to date.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 27th Jun 2019 19:53
Hi MadBit...

Thank you for your update but not to worry.

The VB Templates appear to work just fine. I believe I have also been able to find a way around the issue with the Agk.Print statement issue I was having for now.

However, I would like to understand why I have been experiencing it. It could be VB.NET related and\or the fact that it interferes with the single-threaded nature of the WinForm when issued under VB.NET.

Steve Naidamast
Sr. Software Engineer
Carharttguy
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 1st Jul 2019 14:06
Hello

I seem to have a problem with transparency. It just doesn't seem to work, can anyone confirm this?
This is my code:



The object is just not transparent, I just see a 'full' object.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 2nd Jul 2019 03:59
You are setting it to mode opaque, that will be solid.

Try mode 1 or 2, you probably want to texture it with something with an alpha channel
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 9th Jul 2019 08:48
New version on the project page available.

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.

Update all VB-Templates

Update to AppGameKit Library 2019.06.11

@Carharttguy :
Just like Ortu says.

@Ortu
Thank you for your help.

@snaidamast
It would be good to see some code that shows us this error.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 11th Jul 2019 23:40
Hello...

I am in the process of moving over some complex screen display code to AgkSharp. This replaces the simple load of my map board with a map board image I created in Tiled.

Instead of using a complete map board image, I am instead using the algorithms that create the map board through individual tiles.

What I do in this instance, is that prior to the game-loop code, I make the following two calls...



The call to the method, "loHexTileMap.Create_TileMap()", is made to a separate class, which has the code as follows...



All of the necessary parameters and data are correctly supplied to this method as far as I have checked.

However, my sprite(s) never appear on the screen.

Because this method is creating my map board outside of the Main module and the game-loop code itself, I believe that somehow my sprite images are getting out of sync with the Main module and the game loop.

Can anyone explain, why my sprite images may not be being displayed as expected?

Thank you...

Steve Naidamast
Sr. Software Engineer
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 12th Jul 2019 18:34
I believe I may have found the issue. However, for the life of me, I cannot see what is wrong with my code.

If I perform the following in my image load loop process as shown below...



... The resulting AgkImage object, loAgkImage, has no image data in it...

The internal structure of loAgkImage shows the following...
>>>
?loAgkImage
{AgkSharp.AgkImage}
Atlas: False
Created: 0
Deleting: True
ExistsParent: False
ExistsUVBounds: True
Height: 0
Image: error BC30657: 'ToPointer' has a return type that is not supported or parameter types that are not supported.
ImageID: 0
MagFilter: Linear {1}
MinFilter: Linear {1}
Parent: {AgkSharp.AgkImage}
Path: "Images/BASE_HEX_DARKGRASS.png"
ScaledAmount: 0
TextureID: 0
TotalHeight: 0
TotalHeight2: 0
TotalWidth: 0
TotalWidth2: 0
Transparent: True
U1: NaN
U2: NaN
V1: NaN
V2: NaN
Width: 0
WrapU: Clamp {0}
WrapV: Clamp {0}
<<<

This appears to demonstrate that my images are not being loaded properly internally. And yet, I am merely copying this code form the samples provided in the AgkSharp Toolkit.

I have also tried to swicth the sub-directory to "media" but this makes no difference.

Since my images are not loading properly internally, they would not be drawn on my map board display either...

Steve Naidamast
Sr. Software Engineer
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Jul 2019 05:41 Edited at: 13th Jul 2019 08:17
It seems to me that the image is not really created at all. I made a screenshot how the values should look like after creating an empty image.



There should at least be a number on Created.
For Image a hexadecimal number (Pointer)
And at U1,U2,V1,V2 corresponding to 0 or 1

Can you confirm if the line where the image is created is reached?

EDIT:
If Agk does not find your image a default image will be created.

EDIT2:
I just read your e-mail.
I will take a closer look at your project soon. At first sight it looks as if agk can't handle the Png format.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 13th Jul 2019 14:40
Thank you, MadBit, for replying so quickly.

As to your concern regarding the ability of AgkSharp using the "png" format, this appears to work fine within the main game loop in the Main module. However, as I noted, it does not appear to work when such code is used in a separate class but I do not believe it has anything to with the "png" format.

Also, as it regards the "png" format, you have a number of samples that I have studied that use this format with no apparent issues when I run them.

I have, as of yet, not tested these methods with a different image format but I can do that today.

As to your other concern; yes, the sprite and image create methods do return what appear to be legitimate sprite\image ids in the expected format of "10001"+. And all of the code I have tested so far is reached and processes without any exceptions that would cause the application to stop processing.

To me, the reason for the non-working create\load processes in my class appears to be that these methods seemingly cannot sync themselves with the expected buffer that is accessed in the main game loop in the Main module.

If you review the code in my class, "HexTileLoadUtilities", method, "Load_HexTileImageLookupDictionaryList", you will find that the current code does return "True" when the "loAgkImage.Load" method is called.

I have tried multiple variations for image and sprite load and creation tests in this method and no variation I tested would work. Yet, if I put the same exact code within the main game loop in the Main module, it works as expected.

Another issues I found with these AgkSharp create\load methods is that if I use a complete path with [ Environment.Current + "\Images\image-name" + ".png" ], the create\load methods will throw a rather strange internal exception, which I have never seen before.

Therefore, the only acceptable path structure must appear as follows... "Images/image-name.png". I believe this may have to do with how your assemblies are interpreting the slashes since your work may be looking at such passed input it from a C\C++ perspective.

However, this is a secondary issue...

Steve Naidamast
Sr. Software Engineer
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Jul 2019 05:48 Edited at: 14th Jul 2019 05:49
I've tracked down the image problem now.
In the code file 'MainModule.vb' you initialize your class 'Classes.HexTileLoadUtilities' before Agk itself is initialized.
This will try to access engine resources that are not yet available.
I simply set the relevant code after engine initialization and it now loads the image files correctly.

the new snippet


However, your grass surface is not yet displayed because the corresponding draw function is not yet executed correctly.

Note that if you are using AgkImage and AgkSprite you will have to draw the sprites in each frame. The engine has no information about these resources. Therefore these objects don't have their own ID's and can't manage and draw these objects.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 14th Jul 2019 13:50
Thank you very much, MadBit, for your assistance in this matter.

I thought that this issue had to be based on something rather minor, such as I was doing something incorrectly.

I did figure that it was related to something being out of sync with the engine's internals but I really had no idea what it could have been since I believed I had set up everything correctly.

I'll be updating my code this afternoon.

and again, thank you for your help...

Steve Naidamast
Sr. Software Engineer
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 15th Jul 2019 23:08
MadBit...

I have been continuing to test my simulation development, now that you have helped resolve my previous issue, using both my original algorithms that draw the map board display tile by tile and the a complete map-board image which will act as the background for the display. The use of drawing the map board tile by tile with the AgkImage and AgkSprite object types does make for a very sluggish process.

As a result, I have opted to rewrite these algorithms to work with an entire map-board image that will be created with the Hexographer software. This way, an initial large sprite can be placed in the map-board display with all other sprites (units) being drawn as required.

BTW, why does the AgkSharp engine slightly enlarge my hexagons whether they are drawn as tiles or as part of a complete image?

Steve Naidamast
Sr. Software Engineer
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jul 2019 13:34
Oops, I didn't notice. You can just fix this buck yourself.

In the function 'CreateWin32Window' in the file 'Core.cs' you change this line
AgkWindow.Size = New Size(Width, Height)
as follows.
AgkWindow.ClientSize = New Size(Width, Height)

I hope things go better now.

I will correct the template. This only affects the VB template.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 18th Jul 2019 16:18
Hi MadBit...

Thank you for your most recent update...

I do not use the AgkCore code that much right now.

Instead, I create my own window as follows...



This is basically doing the same thing as your Core code is doing for window creation...

Steve Naidamast
Sr. Software Engineer


MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 19th Jul 2019 13:56
I saw in your project, what you sent me by email, that you have different values in Create_WindowForm and SetVirtualResolution.

You should use the same values in both functions to avoid the distortions you described.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
snaidamast
5
Years of Service
User Offline
Joined: 16th Oct 2018
Location:
Posted: 24th Jul 2019 18:47
Thank you, MadBit...

I'll make the changes as you suggested...

Steve Naidamast
Sr. Software Engineer
linus369
4
Years of Service
User Offline
Joined: 29th Sep 2019
Location:
Posted: 29th Sep 2019 11:13
Not sure if this is the right place to ask, anyhow: I have bought a license for the AppGameKit VR to do some coding (just for fun) for my Oculus Rift. Wondering if there is also a way to do this with AGKsharp?

I have some knowledge of programming, but not too deep, and mainly interested in doing it on a hobby base. So not too keen in doing overheaded things like "mixed project with C# and Tier2" something ... Just refreshing and updating my C# with AppGameKit while targeting my VR headset would be great ... Maybe there is some overseen support for the VR module by AGKsharp, or somebody has already found a way to adress this?

Thanks, Andreas
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Oct 2019 06:30
I think I'm gonna have to disappoint you. To work with the VR module of AppGameKit, all functions of the module would have to be wrapped.
Maybe you can find an SDK at NuGet which you can use. Something like OpenVR.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
linus369
4
Years of Service
User Offline
Joined: 29th Sep 2019
Location:
Posted: 6th Oct 2019 09:28 Edited at: 6th Oct 2019 16:09
Hi MadBit,
thanks for your answer!

Also not what I hoped for ... wrapping the VR commands is above my knowledge (and my enthusiasm to spend the required investigation + work) so I thought about another way to do this - have seen it is possible to create own plugins. Would it do the job if i create a C++ dll simply exporting the VR commands as decribed here: ([href=https://www.appgamekit.com/documentation/guides/14_plugins.htm]), then using them from AGKsharp?

Would bet it is NOT possible because of mixing wrapped functions and exported functions, but always better to ask to be sure

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 ...

Thanks,
Andreas
linus369
4
Years of Service
User Offline
Joined: 29th Sep 2019
Location:
Posted: 6th Oct 2019 16:13
Hi MadBit,
thanks for your answer!

Also not what I hoped for ... wrapping the VR commands is above my knowledge (and my enthusiasm to spend the required investigation + work) so I thought about another way to do this - have seen it is possible to create own plugins. Would it do the job if i create a C++ dll simply exporting the VR commands as decribed here[href=https://www.appgamekit.com/documentation/guides/14_plugins.htm]), then using them from AGKsharp?

Would bet it is NOT possible because of mixing wrapped functions and exported functions, but always better to ask to be sure

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 ...

Thanks,
Andreas
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Oct 2019 15:44
Hi MadBit,
I have just been trying the memblock commands and I am getting an odd result. When I use the code below where "primitive.Id" is the id of a simple 3D Box primitive, I get 24 vertices detected ("verts") but the Vertex position commands (IE. Agk.GetMeshMemblockVertexX) always return zero. Can you check if this is an issue in your library as it seems to be tested code from the community, created by chafari and converted to C# by me.
Using AppGameKit V2 Tier 1
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 9th Oct 2019 21:15
Hi,
i tested it with this code and it works fine.
Please make sure that your object actually exists and that due uses the memblock functions after engine initialization.


Here I have created another variant. I think this is a bit more elegant than working with memblocks.
Maybe this gives some inspiration.


Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
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
17
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
VIP Member
Gold Codemaster
14
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
VIP Member
Gold Codemaster
14
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
17
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

Login to post a reply

Server time is: 2024-03-29 12:10:24
Your offset time is: 2024-03-29 12:10:24