Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:33:57+00:00 2026-05-24T08:33:57+00:00

I have a static library Xcode 4 project that includes a home-brewed rendering engine,

  • 0

I have a static library Xcode 4 project that includes a home-brewed rendering engine, and I re-use this engine in multiple apps. This engine uses OpenGL ES 2.0, and by extension, shaders. As shaders got more complicated, I moved away from storing them as NSStrings in a source file, and now store them as standalone text files with the .vert and .frag extensions.

This works fine for apps that include the rendering engine in their own source; the shaders are simply added to the app’s “Copy Bundle Resources” build phase, and loaded at runtime into NSStrings and compiled, linked, etc.

This strategy doesn’t work at all if the rendering engine that loads these shaders is in a static library project; there is no bundle into which to copy resources. I’m currently forced to have every client project of the static lib rendering engine include their own copies of the shaders in their own “Copy Bundle Resources” build phase. This is a giant pain, and defeats a large part of the convenience of making the render engine into a static lib in the first place.

I suppose this is specific instance of the more general problem of “Resources in a Static Library”. The best solution I can think of is copying the shader files’ contents into strings in a header file, which are then included in the rendering engine’s source. I may even be able to automate the conversion from .frag to .h with some “Run Scripts” build phase magic, but it seems unfortunately complicated.

Is there anything I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:33:58+00:00Added an answer on May 24, 2026 at 8:33 am

    You could try to create a framework, it seems to fit your needs. There’s an example on how to create such a framework for iOS on this page:

    http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/

    The guy that wrote the guide actually uses this technique to distribute his own iOS 3D engine project.

    Edit: linked to newer version of the guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that has a dependency on a static library. In Xcode
I have an Xcode project with several static library dependancies set up in the
I have a static library project that I inherited from another developer. I added
I have an iPhone SDK project that is supposed to build a static library
I have an xcode Objective-C iPhone static library project. When I build it in
I have an Xcode 4 project that has my iOS app and a static
gcc 4.5.1 Fedora 14 Linux I have this static library that was build from
I have an monotouch application that includes an objective-c static library. The application runs
I have a static library that I want to distribute that has includes Foo.c/h
I have a static library (let's call it S) that uses a category (NSData+Base64

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.