public abstract void RunRenderLoop(Window window, Func<bool> fnFrame);
public abstract IRenderContext CreateRenderContext(Window window);
void Initialize() { // Search entities for EmbedAttribute Type[] entityTypes = Assembly.GetEntryAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(Entity))).ToArray(); foreach (Type type in entityTypes) { FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); foreach (FieldInfo field in fields) { EmbedAttribute embed = (EmbedAttribute) field.GetCustomAttributes(typeof (EmbedAttribute), false).SingleOrDefault(); if (embed != null) { Console.WriteLine("TODO: Embed attribute with source {0}", embed.Source); field.SetValue(null, new ResourceInfo(embed.Source)); } } } m_window = s_platformFactory.CreateWindow((int) Width, (int) Height); m_renderContext = s_platformFactory.CreateRenderContext(m_window); IsRunning = true; OnInitialize(); }