Problems loading textures...

Jun 13, 2010 at 6:03 PM

Okay...this was working until i downloaded the last version of source code...

Then i started getting this error...

Failed to create a 'Balder.Core.Imaging.Image' from the text '/Portfolio;component/Images/black.png'. [Line: 11 Position: 44]

So i deleted all the bin/   files, made some code changes like LoadTexture()  to :

        private Balder.Core.Imaging.Image LoadTexture(string uri)
        {
            // Todo: this is very hacky - refactoring of the asset system will make this not needed!
            var assetLoaderService = Runtime.Instance.Kernel.Get<IAssetLoaderService>();
            var loader = assetLoaderService.GetLoader<Balder.Core.Imaging.Image>(uri);
            var images = loader.Load(uri);
            if (images.Length == 1)
            {
                return images[0] as Balder.Core.Imaging.Image;
            }
            return null;
        }

 

but i started getting this error...

The invocation of the constructor on type 'Balder.Core.Materials.Material' that matches the specified binding constraints threw an exception. [Line: 11 Position: 44]

I've a feeling that something changed...but this error appears in the App:Application ctor after InitializeComponent() and my XAML code looks like that:

 

  xmlns:Execution="clr-namespace:Balder.Core.Execution;assembly=Balder.Core"
    xmlns:Geometries="clr-namespace:Balder.Core.Objects.Geometries;assembly=Balder.Core"
    xmlns:Lighting="clr-namespace:Balder.Core.Lighting;assembly=Balder.Core"
    xmlns:View="clr-namespace:Balder.Core.View;assembly=Balder.Core"
    xmlns:Materials="clr-namespace:Balder.Core.Materials;assembly=Balder.Core"
    xmlns:local="clr-namespace:Portfolio.Resources"
    xmlns:localGame="clr-namespace:Portfolio"

    mc:Ignorable="d" d:DesignWidth="1024" d:DesignHeight="800">
    <Grid x:Name="LayoutRoot" ShowGridLines="False"   Width="1024" Height="800" Background="Black"  >
        <Grid.RowDefinitions  >
            <RowDefinition Height="42*"></RowDefinition>
            <RowDefinition Height="100*"></RowDefinition>
            <RowDefinition Height="10*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions >
            <ColumnDefinition Width="3*"></ColumnDefinition>
            <ColumnDefinition Width="10*"></ColumnDefinition>
            <ColumnDefinition Width="2*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.Resources >

           
            <Materials:Material x:Key="letterMaterial"  Diffuse="Yellow" Shade="Flat" />
            <Materials:Material x:Key="evolveMaterial1"   DiffuseMap="/Portfolio;component/Images/evolve1.png"/>
            <Materials:Material x:Key="evolveMaterial2"   DiffuseMap="/Portfolio;component/Images/evolve2.png"/>
            <Materials:Material x:Key="evolveMaterial3"   DiffuseMap="/Portfolio;component/Images/evolve3.png"/>
            <Materials:Material x:Key="evolveMaterial4"   DiffuseMap="/Portfolio;component/Images/evolve4.png"/>
            <Materials:Material x:Key="logoMaterial1"   DiffuseMap="/Portfolio;component/Images/logoBrush1.png"/>
            <Materials:Material x:Key="logoMaterial2"   DiffuseMap="/Portfolio;component/Images/logoBrush2.png"/>
            <Materials:Material x:Key="logoMaterial3"   DiffuseMap="/Portfolio;component/Images/logoBrush3.png"/>
            <Materials:Material x:Key="logoMaterial4"   DiffuseMap="/Portfolio;component/Images/logoBrush4.png"/>
            <Materials:Material x:Key="sphereMaterial"   ReflectionMap="/Portfolio;component/Images/ReflectionMap.jpg"/>
            <Materials:Material x:Key="ringMaterial"   ReflectionMap="/Portfolio;component/Images/ReflectionMap.jpg"/>

...

 

Some help is needed...although i've SampleBrowser working and i saw some new stuff like ViewModel...do i need that?

 

 

Jun 13, 2010 at 6:06 PM

Sorry... the detail was something like this...

 

~Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Balder.Core.Execution.PlatformKernel..ctor(Type platformType) in C:\Balder\Source\Balder.Core\Execution\PlatformKernel.cs:line 40
   at Balder.Core.Execution.Runtime.GetRuntime() in C:\Balder\Source\Balder.Core\Execution\Runtime.cs:line 76
   at Balder.Core.Execution.Runtime.get_Instance() in C:\Balder\Source\Balder.Core\Execution\Runtime.cs:line 63
   at Balder.Core.Materials.Material..ctor() in C:\Balder\Source\Balder.Core\Materials\Material.cs:line 44

 

I'll add the silverlight project to my solution and try to see why this is happening...

 

Coordinator
Jun 14, 2010 at 5:20 AM
Could you email me the project?
Jun 14, 2010 at 8:58 AM

Hi, Adept...

Since SampleBrowser is working good, i'll try to re-make my project from a clean start using SampleBrowser as a template.

It must be something to do with wrong Dlls i guess, if i still have problems then i let know...

Thanks

Coordinator
Jun 15, 2010 at 8:37 AM

Just let me know.