It is currently Sat Aug 22, 2020 4:27 am


All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: LargeVolume on VS2012
PostPosted: Thu Sep 19, 2013 2:22 am 

Joined: Tue Sep 10, 2013 5:24 pm
Posts: 2
Is there currently any way to use the LargeVolume on Visual Studio 2012?
I've seen other posts about it here, but no solution yet.

I tried a few of the versions (0.2.1, hotfix, and developer I believe) and they all seem to have their own issues.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Thu Sep 19, 2013 3:56 am 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
I was directed to use the developer version but it too had it's own errors, I'll try to use LargeVolume again and post the results.

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Fri Sep 20, 2013 8:58 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I just tested the develop version of PolyVox on VS2012. I couldn't build the bindings (I don't have SWIG, etc installed) and there was one error related to the AStarPathfinder when building the tests, but apart from that it seems to work on. The examples build and run correctly and I believe the LargeVolume works.

Can you disable the bindings and tests (via CMake) and then post any compile errors you are getting? Even if the bindings/tests are left enabled you will get errors from them, but the examples should still build OK.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Fri Sep 20, 2013 11:01 am 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
I was able to get it to compile in my project :)

Notable changes:
Runtime Library Multi-threaded (/MT) <--have to have that to be compatible with my network library
ENABLE_BINDINGS (disabled)
ENABLE_EXAMPLES (disabled)
ENABLE_TESTS (disabled)
LIBRARY_TYPE (dynamic) <---might switch this to static and compile it via .dll (static lets you make it into a .dll right? :P )
SPHINXBUILD_EXECUTABLE (not found)
SWIG_EXECUTABLE (not found)

Full optimizations, favor fast code over small code, floating point to fast instead of precise.

Upon running the program I get an access violation pointing to this line of LargeVolume.inl
Code:
m_pPager->pageIn(reg, pBlock);

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Sat Sep 21, 2013 6:42 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Great, I'm glad you got it to compile.

The crash is probably because m_pPager is null? When you construct a LargeVolume you need to give it an instance to a 'Pager' class which will be used to move data into memory in the first place and then page it out when there is too much. What this Pager does with the data is up to you, but the sample 'FilePager' implementation just saves it to disk. Alternatively, the example 'PerlinNoisePager' generates the inital data from Perlin noise and then just discards it on overflow. Have a look at these files to get an idea of the logic.

You can create a LargeVolume something like this:

Code:
MinizBlockCompressor<int32_t>* pBlockCompressor = new MinizBlockCompressor<int32_t>;
FilePager<int32_t>* pFilePager = new FilePager<int32_t>("./");
LargeVolume<int32_t>* pLargeVolume = new LargeVolume<int32_t>(region, pBlockCompressor, pFilePager, 32);


Of course, PolyVox should not try to use the pager if it is null (or it should force it not to be null) but there may be a few more issues like this which still need to be fixed in the LargeVolume.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Sat Sep 21, 2013 11:50 am 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
I can't seem to figure out why this code is returning errors:
Code:
PolyVox::MinizBlockCompressor<int32_t>* pBlockCompressor = new PolyVox::MinizBlockCompressor<int32_t>;
PolyVox::FilePager<int32_t>* pFilePager = new PolyVox::FilePager<int32_t>("./");
PolyVox::Region this_region = PolyVox::Region(PolyVox::Vector3DInt32(0,0,0), PolyVox::Vector3DInt32(1024,32,1024));
PolyVox::LargeVolume<int32_t>* pLargeVolume = new PolyVox::LargeVolume<int32_t>(this_region,pBlockCompressor, pFilePager, 64);


Errors:
Code:
 6 IntelliSense: no instance of constructor "PolyVox::LargeVolume<VoxelType>::LargeVolume [with VoxelType=int32_t]" matches the argument list
            argument types are: (PolyVox::Region, PolyVox::MinizBlockCompressor<int32_t> *, PolyVox::FilePager<int32_t> *, int)   \DX-Server\ChunkManager.h   5

 5 IntelliSense: incomplete type is not allowed   \DX-Server\ChunkManager.h   5


Code:
error C2664:
'PolyVox::LargeVolume<VoxelType>::LargeVolume(const PolyVox::Region &,PolyVox::BlockCompressor<VoxelType> *,PolyVox::Pager<VoxelType> *,uint16_t)' : cannot convert parameter 3 from 'PolyVox::FilePager<VoxelType> *' to 'PolyVox::Pager<VoxelType> *'   \dx-server\ChunkManager.h   5

error C2514:
'PolyVox::FilePager<VoxelType>' : class has no constructors   \dx-server\ChunkManager.h   3

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Sat Sep 21, 2013 12:19 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I think you haven't included the required headers (probably FilePager.h?). In this case it's will see the forward declaration of FilePager in PolyVoxForwardDeclarations.h but won't have the class definition.

This has caught me out before... I'm not sure these forward declarations are such a smart idea but they are supposed to reduce compilation time. Maybe they don't make sense in projects which are mostly headers (like PolyVox)? I have to think about this.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Sat Sep 21, 2013 12:50 pm 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
After including the proper file:
Code:
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.   C:\Users\DX-Server\PolyVox\include\PolyVoxCore\FilePager.h   89

Refering to this line of that file:
Code:
         FILE* pFile = fopen(filename.c_str(), "rb");





After changing two lines in FilePager.h it compiled and my program ran.
Lines 88 & 135
Code:
         FILE* pFile;
         fopen_s(&pFile,filename.c_str(), "rb");

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Sat Sep 21, 2013 3:28 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yeah, that's a Visual Studio thing... they don't like you using standard functions and prefer you to use their own versions. You can just ignore that volume really... maybe we should supress it through CMake.

Also, I logged an issue for the use of forward declarations as we should really think if they make sense: https://bitbucket.org/volumesoffun/polyvox/issue/45/use-of-forward-declarations-is-confusing

Glad you got it working anyway :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Tue Sep 24, 2013 9:46 am 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
I also just received this error
Code:
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.   \PolyVox\include\PolyVoxCore\FilePager.h   89


Referring to this line:
Code:
FILE* pFile = fopen(filename.c_str(), "rb");


Which I replaced with:
Code:
      FILE* pFile;
         fopen_s(&pFile, filename.c_str(), "rb");


The same thing must be done a few lines further down
:)

But receiving error in program console: "Unable to open file to write out block data."
:/

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net