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.

Dark GDK / [DarkGDK.NET] ARGH!!

Author
Message
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 00:11
First of all I have to say that the new release of this toolkit is simply great!

Second I\'ve encountered an awfull exception when cloning a sound...More precisely an InvalidCastException...Why? I simply execute these lines:



And third (this is what makes me shout \"ARGH!!!!\") the Ink function and the FontSize property are EXTREMELY slow. For example if a switch 2 colors more than 4 times in the same loop my fps goes under 30. If I do this just 10 times my fps goes to 0!!!!! Why this function become so slow comparing to the previous release of DarkGDK.NET??

Am I doing something wrong? Have I to do some tricks to print out coloured text? And what about the font size?

Thanks to all who will help me

Fear leads to anger
Anger leads to hate
Hate leads to suffering
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Dec 2008 00:17
Maybe you cant clone the sound while its playing?

With FontSize try to use kBessa's Textplugin. I dont know if that fix it.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 10th Dec 2008 04:05
@Yoda:

Yes, DGDK's text methods are extremely slow. You might try out my plugins, I once tried changing to 10 diferent fonts and 30 different colors each loop without a drop on FPS.

About the clone method, have you attributed it to some other variable? like in Dim newSound as new Sound = sound.Clone() ????

Don't remember if that's the correct code, I'm not the vb.net guy

[center][center]
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 10:44
Where can I get this wonderfull plugin? How I make it work with .NET?

About my sound problem: I just declare a new sound object! The object is correctly loaded but when I call the clone command I get the invalidcastexception. Even if I call the clone function immediately after the constructor call! The exception by the library and not by my code!

Fear leads to anger
Anger leads to hate
Hate leads to suffering
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Dec 2008 10:51
@Yoda: at www.kbessa.net (look in his sig).

You just add reference to the dll and its working...

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Dec 2008 10:54
@Yoda: It looks like that sound.clone returns a new sound-object.

So maybe like this:



I have not tried that yet but thats how I want to make it.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 11:41
[CODE]
Dim s1 As New DarkGDK.Audio.Sound(My.Application.Info.DirectoryPath & "\Bin\Sounds\ping.wav")
Dim s2 As DarkGDK.Audio.Sound = s1.Clone
[/CODE]

The execution stops inside the function Clone, not during the assignment. It seems that the Clone function has to return SoundBase type instead of Sound type. Am I the only one who encountered this problem? Even if I highlight "s1.Clone" and press Shift+F9 (to open the expression evaluator of Visual Studio) it throws InvalidCastException.

I tried this code also, without any success:

[CODE]
Dim s1 As DarkGDK.Audio.SoundBase = New DarkGDK.Audio.Sound(My.Application.Info.DirectoryPath & "\Bin\Sounds\ping.wav")
s1.Clone
[/CODE]

Fear leads to anger
Anger leads to hate
Hate leads to suffering
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Dec 2008 12:14
The Clone method in Sound does return a Sound class. It can be in the convert betweem SoundBase and Sound in the method. Thats why it returns "InvalidCastException"

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 12:14
@Niels Henriksen: Thanks for the hint about LightPlugin

@kBessa: Your plugin works perfectly. Can I ask you how have you achieved this critical improvement to text functions? I'm not asking you the implementation, only the idea behind your plugin. You have done a great work.

Fear leads to anger
Anger leads to hate
Hate leads to suffering
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 12:18
@Niels Henriksen: I know that it returns a Sound class...but what I can't understand is why I create a SOUND object, then I call the clone method of the SOUND class (which returns a SOUND class) and I get an exception!! I'm not using the SOUNDBASE class directly in any way. :-(

Fear leads to anger
Anger leads to hate
Hate leads to suffering
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 10th Dec 2008 12:25
Yoda:

TGC are doing this in the Sound Class



Where you can see that they are casting the soundbase to sound. The problem can be there...

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Yoda Master
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: Genova
Posted: 10th Dec 2008 12:33
Thanks!

So is it a bug? It isn't possible to cast a Base class to its Derivate class, is it?

Fear leads to anger
Anger leads to hate
Hate leads to suffering
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 10th Dec 2008 12:57
@Yoda:

I've wrapped DirectX methods myself, although I was using SlimDX, which is similar to the old Managed DirectX. I recommend it to anybody wanting to use DirectX calls without having to write C++ code.
Quote: "http://slimdx.mdxinfo.com"


[center][center]

Login to post a reply

Server time is: 2024-11-25 07:26:33
Your offset time is: 2024-11-25 07:26:33