Sunday, August 16, 2015

How to render open TK GameWindow App with Win Forms ?

http://www.opentk.com/node/4026

1) Run WinForm and GameWindow App in two different thread as below

using System;
using System.Threading;
using System.Windows.Forms;
using Debug = System.Diagnostics.Debug;
using OpenTK;
using OpenTK.Graphics.OpenGL;
 
namespace OpenTKWinForms
{
 class MainClass
 {
  static GameWindow window;
  static Form form;
  static OpenTK.Graphics.Color4 color;
 
  public static void Main(string[] args)
  {
   // OPTION 1: Start windows form in a new thread.
   // Form is created either here or inside ThreadStart.
//   form = new Form();
//   form.Click += Form_Click;
//   var threadForm = new Thread(new ThreadStart(() => {
//    form = new Form();
//    form.Click += Form_Click;
//    Application.Run(form);
//   }));
//   threadForm.Start();
 
//   window = new GameWindow();
//   window.RenderFrame += Window_RenderFrame;
//   window.Run(2.0, 2.0);
 
   // OPTION 2: Start OpenTK window in a new thread.
//   var threadOpenTK = new Thread(new ThreadStart(() => {
//    window = new GameWindow();
//    window.RenderFrame += Window_RenderFrame;
//    window.Run(2.0, 2.0); 
//   }));
//   threadOpenTK.Start();
//
//   form = new Form();
//   form.Click += Form_Click;
//   Application.Run(form);
  }
 
  static void Form_Click (object sender, EventArgs e)
  {
   var r = new Random();
   var c1 = new float[]
   {
    (float)r.NextDouble(),
    (float)r.NextDouble(),
    (float)r.NextDouble()
   };
   var c2 = new int[]
    {
     (int)(c1[0] * 255),
     (int)(c1[1] * 255),
     (int)(c1[2] * 255)
    };
 
   color = new OpenTK.Graphics.Color4(c1[0], c1[1], c1[2], 1f);
   form.BackColor = System.Drawing.Color.FromArgb(c2[0], c2[1], c2[2]);
  }
 
  static void Window_RenderFrame (object sender, FrameEventArgs e)
  {
   GL.ClearColor(color);
   Debug.WriteLine(color);
   GL.Clear(ClearBufferMask.ColorBufferBit);
   window.SwapBuffers();
  }
 }
}

Friday, August 7, 2015

33 Websites That Will Make You a Genius

33 Websites That Will Make You a Genius

“I have no special talent, I am only passionately curious.” – Albert Einstein

There is a good chance you’ll be able to put at least one of these learning tools to good use and come out as a better person than you were last year. These are some of the best websites that will make you smarter every day.
  1. BBC — Future — Making you smarter, every day.
2. 99U (YouTube) — Actionable insights on productivity, organization, and leadership to help creative people push ideas forward.
3. Youtube EDU — The education videos that don’t have cute cats in boxes — but they do unlock knowledge.
4. WikiWand — A slick new interface for Wikipedia.
5. The long read (The Guardian) — In-depth reporting, essays and profiles.
6. TED — Great videos to open your mind on almost every topic.
7. iTunes U — Learning on the go, from some of the world’s top universities.
8. InsightfulQuestions (subreddit) — Intellectual discussions that are not necessarily genre-specific.
9. Cerego — Cerego helps you build personalized study plans based on your strengths and weaknesses to retain knowledge.
10. University of the People — Tuition-free online university that offers higher education in multiple course streams.
11. OpenSesame — Marketplace for online training, now with 22,000+ courses.
12. CreativeLive — Take free creative classes from the world’s top experts.
13. Coursera — Partnering with some of the top U.S. universities, Coursera offers massive open online courses for free.
14. University of reddit — the product of free intellectualism and is a haven for the sharing of knowledge.
15. Quora — You ask, the net discusses — with top experts and fascinating back and forth on everything.
16. Digital Photography School— Read through this goldmine of articles to improve your photography skills.
17. Umano -Explore the largest collection of audio articles powered by real people. Dropbox has acquired Umano. Brain Pickings is a great replacement for 17.
Brain Pickings — Insightful long form posts on life, art, science, design, history, philosophy, and more.
18. Peer 2 Peer University or P2PU, is an open educational project that helps you learn at your own pace.
19. MIT Open CourseWare is a catalog of free online courses and learning resources offered by MIT.
20. Gibbon— This is the ultimate playlist for learning.
21. Investopedia — Learn everything you need to know about the world of investing, markets, and personal finance.
22. Udacity offers interactive online classes and courses in higher education.
23. Mozilla Developer Network offers detailed documentation and learning resources for web developers.
24. Future learn — enjoy free online courses from top universities and specialist organisations.
25. Google Scholar  — provides a search of scholarly literature across many disciplines and sources, including theses, books, abstracts and articles.
26. Brain Pump — A place to learn something new everyday.
27. Mental Floss — Test your knowledge with amazing and interesting facts, trivia, quizzes, and brain teaser games.
28. Learnist — Learn from expertly curated web, print and video content.
29. DataCamp — Online R tutorials and data science courses.
30. edX — Take online courses from the world’s best universities.
31. Highbrow — Get bite-sized daily courses to your inbox.
32. Coursmos — Take a micro-course anytime you want, on any device.
33. Platzi— Live streaming classes on design, marketing and code.