Skip to content
Permalink
Browse files

Added channel number enums in stbi, retouched readme and kinda forgot…

… github already had contributors tracked so linked to that instead
  • Loading branch information...
lmariscal committed Feb 10, 2019
1 parent 39a261d commit 9357a19d61b197f1c95a01e42410881ec09ec144

This file was deleted.

This file was deleted.

@@ -44,7 +44,7 @@ event. Representation of a project may be further defined and clarified by proje
== Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
mailto:leo@cav.bz[leo@cav.bz]. All complaints will be reviewed and investigated and will result in a response that
mailto:leo@ldmd.mx[leo@ldmd.mx]. All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality
with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

@@ -5,12 +5,11 @@ We are really glad you're reading this, because we need volunteer developers to
=== Code of Conduct

This project and everyone participating in it is governed by the link:CODE_OF_CONDUCT.adoc[Code of Conduct]. By
participating, you are expected to uphold this code. Please report unacceptable behavior to mailto:leo@cav.bz[leo@cav.bz].
participating, you are expected to uphold this code. Please report unacceptable behavior to mailto:leo@ldmd.mx[leo@ldmd.mx].

=== Help and Improvements

Feel free to join the Nim IRC channel in link:irc://freenode.net/#nim[FreeNode#nim], there you can tag `cavariux` and we
will try to help at our full extend.
Feel free to email me at the email provided above or tweet me at my https://ldmd.mx/twitter[@thelmariscal].

=== Bug Report

@@ -39,10 +38,9 @@ Before starting to modify the code please install the Editor Config extension fo
find them at http://editorconfig.org/.

. Fork the Repo
. Clone the repo with git.
. Clone the repo with `git clone --recursive -j8 git@github.com:lmariscal/nimgl.git`
. Run `nimble build`
. Modify, commit and push.
. Put yourself on the link:CONTRIBUTORS.adoc[CONTRIBUTORS] file!
. Create Pull Request with squashed commits and changelog.
. Remember to make the Pull Request to the `develop` branch

This file was deleted.

@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Leonardo Mariscal
Copyright (c) 2019 Leonardo Mariscal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,25 +1,17 @@
link:https://circleci.com/gh/lmariscal/nimgl[image:https://circleci.com/gh/lmariscal/nimgl.svg?style=svg[alt="circleci"]]
link:https://github.com/lmariscal/nimgl[image:https://img.shields.io/github/stars/lmariscal/nimgl.svg?style=social&logo=github&label=Stars[alt="stars"]]
link:https://buymeacoff.ee/lmariscal[image:https://img.shields.io/badge/buy%20coffee-donate-orange.svg?style=flat-square[alt="buy me a coffee"]]
image:https://img.shields.io/github/last-commit/lmariscal/nimgl.svg?style=flat-square[alt="last commit"]
link:LICENSE[image:https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square[alt="license"]]
link:https://nimgl.org/docs/nimgl.html[image:https://img.shields.io/badge/docs-passing-ff69b4.svg?style=flat-square[alt="docs"]]


== Nim Game Library (WIP) image:https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png[alt="nimble"]
== Nim Game Library (WIP) link:https://github.com/nim-lang/nimble[image:https://raw.githubusercontent.com/yglukhov/nimble-tag/master/nimble.png[alt="nimble"]]

NimGL (Nim Game Library) is a collection of bindings for popular APIs, mostly used in computer graphics.

This collection of bindings is heavily inspired by LWJGL3, it enables low level access and it is not a framework, so we highly encourage you to use other game engines if you don't have experience working with low level graphics developments.
We try to keep this bindings as similar to the originals but we do have some usefull toolkits or some variations on procedures to help with development and suit it to the language.

NimGL is open source and is under the MIT License, we highly encourage every developer that uses it to make improvements and fork them here.

==== NimGL is under heavy development so expect drastic changes and improvements

=== Install

You will need nimble to install this library.
You will need link:https://github.com/nim-lang/nimble[nimble] to install this library.

[source,shell]
-----------------
@@ -36,8 +28,8 @@ import nimgl/<binding>
It is currently being developed and tested on

* Windows 10
* Mac High Sierra
* Linux Ubuntu 18.04
* MacOS Mojave
* Linux Ubuntu 18.10

=== Contribute

@@ -110,3 +102,15 @@ proc main() =
main()
-----------------

=== License

link:https://github.com/lmariscal/nimgl/blob/master/LICENSE[MIT License].

NimGL is open source and is under the MIT License, we highly encourage every developer that uses it to make improvements and fork them here.

=== Contributors

Thank you to every contributor that has spent their time improving this library.

link:https://github.com/lmariscal/nimgl/graphs/contributors[List of all contributors.]
@@ -1,4 +1,4 @@
# Copyright 2018, NimGL contributors.
# Copyright 2019, NimGL contributors.

## STB Module | stb_image.h - Image loading/decoding library
## ====
@@ -22,11 +22,24 @@ type
height*: int32
channels*: int32
data*: ptr cuchar
STBIChannels* {.size: int32.sizeof.} = enum ## Enum to avoid using ugly constants
stbiDefault = 0
stbiGrey = 1
stbiGrey_alpha = 2
stbiRGB = 3
stbiRGBAlpha = 4

converter toInt32*(x: STBIChannels): int32 =
x.int32

converter toInt*(x: STBIChannels): int =
x.int

proc stbiLoad*(filename: cstring, width: ptr int32, height: ptr int32, channels: ptr int32, components: int32 = 0): ptr cuchar {.stb_image, importc: "stbi_load".}
## returns a pointer to the image requested, nil if nothind found.
## width and height as you imagine are from the image
## channels, how many channels the image has
## 0 default
## 1 grey
## 2 grey, alpha
## 3 red, green, blue

0 comments on commit 9357a19

Please sign in to comment.
You can’t perform that action at this time.