I have been taking in lots of tuts (most notable influence was Excellent DX10 Tutorial Site) and have probably missed something really silly here as it is now 02:20 in the a.m. for me and ive been at it since early this afternoon.
Reason for question: I put a manager class in to keep direct x out of winMain, and to start a hopeful journey by which to have my own directX template to work from (leaving simple sample behind)
Problem: I cant seem to load the effect(fx) file. Like I stated, probably something waaaay too obvious to the eagle-eyed amongst you but , if anybody could help or point out the stupidity of my mistake with a constructive reasoning, well.
It would really really help.
Thanks once again for reading this.
Zipped vs2010 solution can be found here MyOOD3Dx10Template
(it obviously needs to be built and the additional libs and includes need to be specified in the properties but im thinking eggs, teaching to suck etc, especially for someone who`s gonna be able to solve this, lol)
Problem Code below (please excuse any weird comments, this has been a work in progress so not culled for pointless starting off comments)
the program bums out after it attempts to load an effect from file around about line 126 on here i think
#include "ManageD3DX.h"
#include <iostream>
using namespace std;
/*Gruffy 2012 - OODirectX*/
//create the actual D3Ddevvice and swapchain
if (FAILED (D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &swapChainDesc, &p_swapChain, &p_d3dDevice)))
return err(L"D3D could not create, this message will self destruct in 5, 4, 3, 2 ...");
/*END SWAPCHAIN AND D3D DEVICE SETUP*/
//SHADER STAGE
//*****************************************************************************
//Load Basic Effect and Technique
//--------------------------------------------------------------
if ( FAILED( D3DX10CreateEffectFromFile( L"basicEffect.fx",
NULL, NULL,
"fx_4_0",
D3D10_SHADER_ENABLE_STRICTNESS,
0,
p_d3dDevice,
NULL,
NULL,
&p_basicEffect,
NULL,
NULL ) ) )
return err(L"Could not load effect file!");
p_basicTechnique = p_basicEffect->GetTechniqueByName("renderTheScene");
//create matrix effect pointers
p_viewMatEffectVar = p_basicEffect->GetVariableByName( "View" )->AsMatrix();
p_projMatEffectVar = p_basicEffect->GetVariableByName( "Projection" )->AsMatrix();
p_worldMatEffectVar = p_basicEffect->GetVariableByName( "World" )->AsMatrix();
//INPUT ASSEMBLY STAGE
//*****************************************************************************
Hi guys code changed to suit request. Though as given, the full project is there, if anyone felt like running it- the problem still happens during load of the effect file failure /success call.
Many thanks for quick replies here dudes.
This post has been edited by gruffy: 08 January 2013 - 04:04 AM

New Topic/Question
Reply



MultiQuote






|