halffoki.blogg.se

Get file path cinder windows
Get file path cinder windows










get file path cinder windows

For example, to load a PNG file as a gl::Texture from your assets folder, you'd do something like this: gl::Texture::create(loadImage(loadAsset( "logo.png"))) Īdditionally, if you need to know where an asset lives in the filesystem, you can call getAssetPath(). The function takes one parameter, which is simply the name of the file you'd like to use. This is a member function of your App, but if you'd like to call it from outside your App, call the loadAsset() variant. To access this file from your code, you'll want to call loadAsset(). Simply place any file you'd like to reference from your application into the assets folder that TinderBox has created for you.

#Get file path cinder windows code

Since these files are as much a part of your app as its source code, they'll generally be managed by your version control system (say, git or Subversion) just as your C++ code or anything else in your project is.Īssets are quite simple to use.

get file path cinder windows

TinderBox creates a project layout with separate folders for both assets and resources. However, distribution and installation can be simpler with resources since there's no way for the data your application depends on to "go missing", and it reduces the chances that a user might modify your data unexpectedly. Assets can be easily modified separately from your code, and they take a lot less work to setup, especially on Windows. The primary difference is that resources are "baked" directly into your application, and assets are separate files living alongside your application. These two techniques have a lot in common. Cinder offers two mechanisms for including data files with your app: assets and resources. Most applications need to reference data outside their own code to do anything very interesting.












Get file path cinder windows