Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example script #27

Open
TooManyDots opened this issue Sep 3, 2020 · 3 comments
Open

Example script #27

TooManyDots opened this issue Sep 3, 2020 · 3 comments

Comments

@TooManyDots
Copy link

TooManyDots commented Sep 3, 2020

I tried using this library today and I couldn't find any working examples. I looked into the tests directory and found this

int main() {
  // Init glfw and opengl
  glfwInit();
  GLFWwindow* window = glfwCreateWindow(800, 450, "rayfork simple glfw example", NULL, NULL);
  glfwMakeContextCurrent(window);
  glfwSwapInterval(1);
  gladLoadGL();

  // Init rayfork
  rf_context rf_ctx = {0};
  rf_default_render_batch rf_mem = {0};
  rf_init(&rf_ctx, &rf_mem, 800, 450, RF_DEFAULT_OPENGL_PROCS);

  // Load a texture with the default libc allocator and io callbacks.
  rf_texture2d texture = rf_load_texture_from_file_ez("bananya.png");

  // Main game loop
  while (!glfwWindowShouldClose(window))
  {
    // Render the image and clear the background to some nice shade of white
    rf_begin();
    rf_clear(RF_RAYWHITE);
    rf_draw_rectangle(0, 0, 100, 100, RF_RED);
    rf_draw_texture(texture, 0, 0, RF_WHITE);
    rf_end();

    glfwPollEvents();
    glfwSwapBuffers(window);
  }
}

But no function named rf_init is either in rayfork.h or rayfork.c and no macro RF_DEFAULT_OPENGL_PROCS was definied. So is there an API or tutorial somewhere how to create a valid context?

@SasLuca
Copy link
Owner

SasLuca commented Sep 3, 2020

The library is still in development and I was busy with some irl-stuff in the past month which is unfortunate.

I created a github template project for people who are interested in testing the library right now, however, it's best to wait until rayfork 1.0 (probably in the next 2 months).

You can try it out here: https://github.com/SasLuca/rayfork-sokol-template

@BugBiteSquared
Copy link

I am curious about what remains to be done for the 1.0 release. I greatly prefer the use of lighter-weight frameworks as opposed to full-on engines for my game projects lately, especially if I'm working in 2D land & don't need bleeding-edge rendering or procedural animation tech from something like Unreal.

I've been eyeing rayfork for a little while now due to my minor quibbles with raylib. I'd love to be able to give this a spin soon.

@SasLuca
Copy link
Owner

SasLuca commented Oct 7, 2020

@BugBiteSquared Currently audio and documentation remain the last pieces of the puzzle before I am comfortable releasing a 1.0 version.
I sadly was quite busy in this period and didn't get to work as much as I wanted on rayfork, but hopefully, I will get more time soon and after 1.0 maybe more contributors as well.

On the raylib discord server there is a #rayfork channel and you can also dm me if you have questions, either on discord or on twitter.

I am hopeful for a 1.0 release this year though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants