Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


ryan20fun

Member Since 06 Oct 2010
Offline Last Active Dec 19 2014 09:49 PM

#5196642 Files

Posted by ryan20fun on 06 December 2014 - 11:16 AM

1. If I write  DATA1 that contains 4bytes for example and I want to return later and write exactly after that DATA1 i set the FilePointer to the sizeof(DATA1 ) of the sizeof(DATA1 ) + 1?

That seams right to me, But you could use some dummy data and a hex editor.

I use HxD to check my binary files.

 

2. WriteFile(  ... (char*)users[0] , sizeof(int)*users_number ) will start to write from element 0 to the last element of the vector because of the sizeof that tells where to stop or because the & operator? What about if I want only to write a single element to the file (like in the last line of the code) it will be ok (char*)sizes[0] or (char*)&sizes[0] with smaller size to write specified in the WriteFile argument ?

That would treat the value of users[0] as the char pointer.

And it would write as many bytes as you tell it to, Which you set correctly.

 

 

 

Some nitpicks:

 

I would advise you use C++ cast operators( static_cast, dynamic_cast, reinterpret_cast ) instead of C syle as they are searchable and I find them more readable.

 

Why does the "WriteFile" function have so many parameters?, Could you not just do the same as std::fstream( pointer, byte count ) ?
 

HTH

-Ryan.




#5194371 What heap wil dynamic memory be created on

Posted by ryan20fun on 24 November 2014 - 03:12 AM

Hello all.

 

I am busy working on makeing a vertual file system, And I've run into a problem that I may have been cruising around because all my DLL libraries are using the same platform toolset( And that means the same heap right? ).

That problem is: Who is responsible for deallocating the memory: Caller or Callee ?

 

So if I create a structure like so:

struct Blob
{
          unsigned char* pData;// std::vector< unsigned char > Data
          size_t Length;
};

(Would the vector dealoccate itself from the right heap?)

 

As far as I know if the structure was allocated on heap A and the caller is using Heap B and deallocates it there will be a crash or segfault or something, Right?

 

So the bottom line is: How do I make sure that the memory is deallocated from the right heap.

 

 

Am I correct in my understanding of dynamic memory here?

 

Many thanks

Ryan.




#5185951 Tutorial Series

Posted by ryan20fun on 09 October 2014 - 04:21 AM

Are you going to upload to YouTube like the "WoA II" journals ?

Because I generally don't watch videos online, I download them first and then go over them as needed smile.png




#5183419 3D Model Loading Problems

Posted by ryan20fun on 27 September 2014 - 11:28 PM

 

 

 

It is typical to see corrupted geometry when programming object importers / exporters. Winding order is the simplest of the problems to solve. Typically invalid output is result of triangles indexing wrong vertices.
 
Cheers!

I know that. But how could a professional 3d software give wrong indices or vertices? 
By the way, vs2012 model view failed to load the obj exported by max. But it worked well with blender's.
The 3D CAD tool 99 times out of 100 produces valid file(albit with there own tweak on some formats like DAE, wavefront object )
The problem most likely exists in your parser code, It is also posible that the CAD tool has produced a edge case with the file.
 
I would recomend that you use a tool like Assimp to do the heavy lifting for you and you just process the data from it.
It's what i do, And it saves me from the hassle of different 3D formats as it handles a nice variety of them.
 
Hope that helps smile.png
i don't know much about assimp.but i think i will have to go there some day. Is there any tutorial about assimp with d3d? If not , gl is fine

 

This ought to get you started.

If you need more help just ask, Or if you want I could post the code I am currently using(but that will change after some time next month due to grabage output when using multiple objects but I am sure that has to do with how I am handling the vertices though... )




#5132964 Bone Importing Basics

Posted by ryan20fun on 20 February 2014 - 08:27 AM

What do you mean by the "intersection point"? Remember, each "bones" is really a matrix, or a set of scale-rotation-translation data.

He probably means the point where the child/parent bone connect, Much like an armature from blender or max.




#5123488 ConLangs (Constructed Languages, Language Creation)

Posted by ryan20fun on 13 January 2014 - 11:53 PM

So how is it going ?

 

Can you give any tips ?, As i've looked at The language Construction Kit and don't understand a lot of it, Proberbly need to google the terms a bit more :(

And have you looked at other conlangs ?

 

I'm interested in the use of conlang's for alien species, As it would be nice to not have all species speaking english( like in mass effect ), But will probably with some type of "universal translater" for the player like in star trek )

 

Good luck with your conlang!




#4855830 C++ int beyond 2,147,483,647?

Posted by ryan20fun on 31 August 2011 - 05:49 AM


btw, is "log long" supposed to be "long long"? thought we were gonna use logarithms hehe.

Yes, it was most likely just a typo on his part; it's supposed to be "long long".


Yes, it was supposed to be long long.
will correct it now.


#4855788 C++ int beyond 2,147,483,647?

Posted by ryan20fun on 31 August 2011 - 01:57 AM

Hi, out of curiousity, is it possible for a C++ integer (or long integer according to what i read) to go beyond 2,147,483,647?

How do i attain it? do i need a certain library or piece of code to make it possible?

Cheers.

yes "long long" / "__int64" although the latter is compiler/OS/vendor specifiec as far as i know
they go from –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
and uses 8 bytes.
big enough for you ?
check out this


#4851686 Sprites and D3D9

Posted by ryan20fun on 20 August 2011 - 12:45 PM

1. I've noticed that the texture is scaling to the closest 64x64, 128x128, 256x256, 512x512, 1024x1024 etc. If my texture is 300 in height, it's going to be scaled to 512 in height. Can I disable this somehow?


it depends, does the card support non power of two textures ?
if so you can manually specify the x and y size, its what i do.

2. What do you think is better? Using Sprites or setting up vertices?


i would vote sprites for now, i think if you are going to upgrade to D3D10 / 11, it might be easier to use vertices and rotate them manually etc.
because from D3D10, Microsoft dropped the fixed function pipeline.

@ryan20fun: Ok, I've checked the Debug Runtime Version. Should I do anything with the Debug Output Level?


the more debug out put D3D will Do.
if you select the highest out put, you will get mesages for everything you did wtong, and forgot to do.

Where will I find this debug help in Visual Studio when I work?


D3D will output the info to the "Output" Window, the one that tells you X has been compiled.


#4851599 Sprites and D3D9

Posted by ryan20fun on 20 August 2011 - 08:15 AM

What header do I have to include to use TDWORD and wstring? Also, I've checked for null values with if statements but didin't find any.

Regarding the Debug Runtimes. This is the window, but now I don't know what to change? Your path worked untill this window :P
Posted Image



@Aerodactyl55: I'm calling it?

Graphics::Graphics(HWND hWnd)
{
	d3d = Direct3DCreate9(D3D_SDK_VERSION);

	ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS));

	d3dpp.Windowed   = true;
	d3dpp.SwapEffect  = D3DSWAPEFFECT_DISCARD;
	d3dpp.hDeviceWindow  = hWnd;
	d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
	d3dpp.BackBufferWidth = 1280;
	d3dpp.BackBufferHeight = 800;

	D3DXCreateSprite(d3ddev, &sprite);

	HRESULT hr = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
}


Thank you btoh for helping me appreciated :)


you need to select the "Use The Debug Version Of Direct3D 9"


#4851361 Sprites and D3D9

Posted by ryan20fun on 19 August 2011 - 02:11 PM

it would be quicker to set a break point and copy the value of the HRESULT and look it up in the DirectX Error Lookup tool / google.



Sorry, but, how do I set a break point? And how can I copy the value of the HRESULT? Sorry, but I've never done this before, first time I even hear about it :/



to set a break point( in VS ) click in the light brown line on the left of the code page, or there should be a add break point here button
when the break point hits, hold the mouse over the hresult and a little box should pop up, select the text in there and copy it.


#4846846 Ambient occlusion simulation for AAA projects

Posted by ryan20fun on 09 August 2011 - 01:44 PM

hardcoded into Crytek engine.


and what makes you think that it is hardcoded ?


#4846578 Ambient occlusion simulation for AAA projects

Posted by ryan20fun on 09 August 2011 - 02:07 AM

It is true what everything above has been said.
I did tried the same thing with my shadow mapping algorithm (CSSM) and got the same response...
I've pitched idea to Crytek and instead of showing interest for the algorithm, Cevat Yerly replied with the yob offer (witch I ended up declining because working on technology that is more inferior than my home projects for mire 4.5K euros a month would probably drove me insane - it would be a waste of my time).

The thing is I want to share my algorithms with the rest but it is getting so darn hard to public them (my old mentor is helping me rewrite them properly).
Basically for the PHD you only need three mayor papers so it would be a shame if I just release them without profiting in ECTS points.


you declined to work at the company thatmade the Crysis series :o ?
im pretty shure they have very sophisticated thechnology.
i would have accepted.


#4846246 How do you create a Win32 window from Console Application?

Posted by ryan20fun on 08 August 2011 - 10:46 AM

they could have attached a Console Window to a Win32 App.


#4842510 [DX8] library for D3DX functions

Posted by ryan20fun on 30 July 2011 - 07:20 AM

Please don't answer me to upgrade to directx9, i need to use version 8.

then can i ask, why do you need DX8 ?




PARTNERS