Skip to content

Commit

Permalink
chore: fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ElhamAryanpur committed Mar 29, 2024
1 parent ee2f86c commit a2f5559
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 32 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contibuting guidelines
# Contributing guidelines

As an open source project, the community is the backbone of the engine. As such, any contribution is welcome. Here are some ways you can contribute:

Expand All @@ -8,6 +8,6 @@ As an open source project, the community is the backbone of the engine. As such,
* `Writing tutorials`: Knowledgebase is important, but tutorials and usage guides are important as well. This is an area the engine lacks a lot and would appreciate help the most!
* `Writing documentation`: The codebase move fast, often times documentation is forgotten to be added until a few versions.

## Contibution license
## Contribution license
By contributing to this repository through issues, addition, modification, or deletion of any kind to the codebase,
you agree to your work being licensed under the same license as the engine, which you can obtain a copy of in the repository.
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM archlinux

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm jdk8-openjdk unzip wget cmake rustup openssl pkgconf

# github override HOME, so here we are
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN rustup toolchain install 1.71.0
RUN rustup default 1.71
RUN rustc --version

RUN rustup target add armv7-linux-androideabi
RUN rustup target add aarch64-linux-android
RUN rustup target add i686-linux-android
RUN rustup target add x86_64-linux-android

# Install Android SDK
ENV ANDROID_HOME /opt/android-sdk-linux
ENV JAVA_HOME /usr/lib/jvm/default
RUN mkdir ${ANDROID_HOME} && \
cd ${ANDROID_HOME} && \
wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
unzip -q sdk-tools-linux-4333796.zip && \
rm sdk-tools-linux-4333796.zip && \
chown -R root:root /opt
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager "platform-tools" | grep -v = || true
RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-31" | grep -v = || true
RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;31.0.0" | grep -v = || true
RUN ${ANDROID_HOME}/tools/bin/sdkmanager --update | grep -v = || true

# Install Android NDK
RUN cd /usr/local && \
wget -q http://dl.google.com/android/repository/android-ndk-r25-linux.zip && \
unzip -q android-ndk-r25-linux.zip && \
rm android-ndk-r25-linux.zip
ENV NDK_HOME /usr/local/android-ndk-r25

# Copy contents to container. Should only use this on a clean directory
COPY . /root/cargo-apk

# This should be on top, but I am saving some time rebuilding the container. Sorry!
RUN pacman -S --noconfirm gcc

# Install binary
RUN cargo install --path /root/cargo-apk

# Remove source and build files
RUN rm -rf /root/cargo-apk

# Add build-tools to PATH, for apksigner
ENV PATH="/opt/android-sdk-linux/build-tools/31.0.0/:${PATH}"

# Make directory for user code
RUN mkdir /root/src
WORKDIR /root/src
4 changes: 2 additions & 2 deletions examples/utils/render_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() {
.objects
.get_mut("layer1")
.expect("failed to gete object");
// set a color to differenciate it
// set a color to differentiate it
layer1
.set_uniform_color(1f32, 0.5, 0f32, 1f32)
.expect("failed to set color");
Expand All @@ -48,7 +48,7 @@ fn main() {
.objects
.get_mut("layer2")
.expect("failed to gete object");
// set a color to differenciate it
// set a color to differentiate it
layer2
.set_uniform_color(0f32, 0f32, 1f32, 1f32)
.expect("failed to set color");
Expand Down
12 changes: 6 additions & 6 deletions src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,32 +304,32 @@ impl crate::header::Renderer {
Ok((uniform_bind_group, uniform_bind_group_layout))
}

/// Creates a new vertex buffer and indecies
/// Creates a new vertex buffer and indices
pub fn build_vertex_buffer(
&mut self,
verticies: &Vec<Vertex>,
indicies: &Vec<u16>,
vertices: &Vec<Vertex>,
indices: &Vec<u16>,
) -> color_eyre::Result<VertexBuffers> {
let vertex_buffer = self
.device
.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: Some("Vertex Buffer"),
contents: bytemuck::cast_slice(verticies.as_slice()),
contents: bytemuck::cast_slice(vertices.as_slice()),
usage: wgpu::BufferUsages::VERTEX,
});

let index_buffer = self
.device
.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: Some("Index Buffer"),
contents: bytemuck::cast_slice(indicies.as_slice()),
contents: bytemuck::cast_slice(indices.as_slice()),
usage: wgpu::BufferUsages::INDEX,
});

Ok(VertexBuffers {
vertex_buffer,
index_buffer,
length: indicies.len() as u32,
length: indices.len() as u32,
})
}

Expand Down
10 changes: 5 additions & 5 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ pub struct Object {
pub rotation: glm::Vec3,
// flags the object to be updated until next frame
pub(crate) changed: bool,
/// Transformation matricies helps to apply changes to your object, including position, orientation, ...
/// Transformation matrices helps to apply changes to your object, including position, orientation, ...
/// Best choice is to let the Object system handle it
pub position_matrix: nalgebra_glm::Mat4,
/// Transformation matricies helps to apply changes to your object, including position, orientation, ...
/// Transformation matrices helps to apply changes to your object, including position, orientation, ...
/// Best choice is to let the Object system handle it
pub scale_matrix: nalgebra_glm::Mat4,
/// Transformation matricies helps to apply changes to your object, including position, orientation, ...
/// Transformation matrices helps to apply changes to your object, including position, orientation, ...
/// Best choice is to let the Object system handle it
pub rotation_matrix: nalgebra_glm::Mat4,
/// Transformation matrix, but inversed
Expand Down Expand Up @@ -168,7 +168,7 @@ unsafe impl Sync for ObjectSettings {}
/// the engine, you might be able to even run the engine in headless mode meaning there would not be a need for a window and the
/// renders would come as image files.
///
/// If you so wish to have a window, you would need to start a window update loop. The update loop of window runs a frame every few milisecond,
/// If you so wish to have a window, you would need to start a window update loop. The update loop of window runs a frame every few millisecond,
/// and gives you details of what is happening during this time, like input events. You can also modify existing parts of the engine during
/// this update loop, such as changing camera to look differently, or creating a new object on the scene, or even changing window details!
///
Expand Down Expand Up @@ -422,7 +422,7 @@ pub struct ShaderSettings {
/// value `!0`
pub mask: u64,
/// When enabled, produces another sample mask per pixel
/// based on the alpha output value, that is ANDed with the
/// based on the alpha output value, that is ANDead with the
/// sample_mask and the primitive coverage to restrict the
/// set of samples affected by a primitive.
Expand Down
26 changes: 13 additions & 13 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ impl Renderer {
///
/// # Arguments
/// * `name` - The name of the object.
/// * `verticies` - A list of vertices for the object to draw with
/// * `indicies` - A list of indicies that references the vertices, defining draw order
/// * `vertices` - A list of vertices for the object to draw with
/// * `indices` - A list of indices that references the vertices, defining draw order
/// * `settings` - The settings of the object
pub fn build_object(
&mut self,
name: impl StringBuffer,
verticies: Vec<Vertex>,
indicies: Vec<u16>,
vertices: Vec<Vertex>,
indices: Vec<u16>,
settings: ObjectSettings,
) -> color_eyre::Result<Object> {
let vertex_buffer = self.build_vertex_buffer(&verticies, &indicies)?;
let vertex_buffer = self.build_vertex_buffer(&vertices, &indices)?;

let uniform = self.build_uniform_buffer(&vec![
self.build_uniform_buffer_part("Transformation Matrix", DEFAULT_MATRIX_4),
Expand Down Expand Up @@ -68,8 +68,8 @@ impl Renderer {

Ok(Object {
name: name.as_string(),
vertices: verticies,
indices: indicies,
vertices: vertices,
indices: indices,
pipeline: Pipeline {
vertex_buffer: PipelineData::Data(vertex_buffer),
shader: PipelineData::Data(shader),
Expand Down Expand Up @@ -119,14 +119,14 @@ impl ObjectStorage {
pub fn new_object(
&mut self,
name: impl StringBuffer,
verticies: Vec<Vertex>,
indicies: Vec<u16>,
vertices: Vec<Vertex>,
indices: Vec<u16>,
settings: ObjectSettings,
renderer: &mut Renderer,
) -> color_eyre::Result<()> {
self.add_object(
name.clone(),
renderer.build_object(name.clone(), verticies, indicies, settings)?,
renderer.build_object(name.clone(), vertices, indices, settings)?,
)?;

/*self.update_object(name, |object| {
Expand Down Expand Up @@ -379,10 +379,10 @@ impl Object {
renderer: &mut Renderer,
) -> color_eyre::Result<(crate::VertexBuffers, crate::UniformBuffers, crate::Shaders)> {
let vertex_buffer = self.update_vertex_buffer_and_return(renderer)?;
let unifrom_buffer = self.update_uniform_buffer_and_return(renderer)?;
let uniform_buffer = self.update_uniform_buffer_and_return(renderer)?;
let shader = self.update_shader_and_return(renderer)?;
self.changed = false;
Ok((vertex_buffer, unifrom_buffer, shader))
Ok((vertex_buffer, uniform_buffer, shader))
}

/// Update and apply changes done to the vertex buffer
Expand Down Expand Up @@ -583,7 +583,7 @@ impl ShaderBuilder {
shader_builder
}

/// Builds the shader with the configruation defined
/// Builds the shader with the configuration defined
pub fn build(&mut self) {
if self.camera_effect {
for i in &self.configs {
Expand Down
8 changes: 4 additions & 4 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ impl Engine {
pub(crate) fn new_inner(settings: WindowDescriptor) -> color_eyre::Result<Self> {
#[cfg(feature = "debug")]
env_logger::init();
// Dimentions of the window, as width and height
// Dimensions of the window, as width and height
// and then are set as a logical size that the window can accept
#[cfg(not(feature = "android"))]
let dimention = winit::dpi::PhysicalSize {
let dimension = winit::dpi::PhysicalSize {
width: settings.width, // Which sets the width of the window
height: settings.height, // And sets the height of the window
};

// Here the size is finally made according to the dimentions we set earlier
// Here the size is finally made according to the dimensions we set earlier
#[cfg(not(feature = "android"))]
let size = winit::dpi::Size::Physical(dimention);
let size = winit::dpi::Size::Physical(dimension);

// And we will create a new window and set all the options we stored
#[cfg(not(feature = "android"))]
Expand Down

0 comments on commit a2f5559

Please sign in to comment.