Just gave that a shot and I'm still getting the same error.for sf2dlib ty a "make clean" before the make!
Can someone tell me how to use sf2d_set_pixel()? It's producing some weird results for me.
...
I've used sf2d_get_pixel() on textures and it works perfectly fine. I don't know if I am doing something wrong or if it is a bug with this function.
Ok, sounds like something that should be fixed though.Alright, so playing around a bit I found out the issue. It seems you can't use sf2d_set_pixel function with a blank texture that was created with sf2d_create_texture function. I am now importing a blank PNG image and now the function works perfectly.
for sf2dlib ty a "make clean" before the make!
HOST Computer: Windows 7 Ultimate x64 SP1
VM Software: VMware Workstation 10.0.1 build-1379776
VM OS: Windows: Windows 7 Ultimate x64 SP1
Windows ISO MD5: c9f7ecb768acb82daacf5030e14b271e
Navigate to Python.org
Download: Python 3.4.3 Windows x86-64 MSI Installer
https://www.python.org/ftp/python/3.4.3/python-3.4.3.amd64.msi
Install Python 3.4.3.
Download: CTRULIB v0.5.0
https://github.com/smealum/ctrulib/releases/tag/v0.5.0
Download: devkitProUpdater-1.5.4
http://sourceforge.net/projects/devkitpro/files/Automated Installer/
Install devkitProUpdater-1.5.4
Copy libctru from ctrulib-master.zip to newly created C:\3DS folder. (notice the directory tree on left)
Download: sf2dlib-master.zip
https://github.com/xerpi/sf2dlib
Copy libsf2d from from sf2dlib-master.zip into C:\3DS
Download aemstro-master.zip
https://github.com/smealum/aemstro
Copy 'aemstro.py' and 'aemstro_as.py' from aemstro-master.zip into newly created C:\devkitPro\aemstro
create System Variable 'AEMSTRO' pointing to C:\devkitPro\aemstro
'make' C:\3DS\libctru then 'make install' that same directory
create System Variable 'CTRULIB' pointing to C:\devkitPro\libctru
attempt and fail to make C:\3DS\libsf2d
-------
PS:
Here's a copy of my VM's SYSTEM PATH if that's relevant
c:\devkitPro\msys\bin;C:\Python34\;C:\Python34\Scripts;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
EDIT: So the make error in 'libsf2d' says something about GPU_SetStencilOP(GPU_KEEP.... That wouldn't possible be related to the latest ctrulib commit about GPU_KEEP would it? I'm just think out loud. IDK, it's probably something I'm doing.
That is true. Hopefully it will be a quick fix for the author. I have not had any other problems so far.Ok, sounds like something that should be fixed though.
You actually found the problem you just had one more step to fix it.
The compile error will go away after you save this fix.
Can someone tell me how to use sf2d_set_pixel()? It's producing some weird results for me.
Here is the current code that I am using:Code:int main() { sf2d_init(); sf2d_set_clear_color(RGBA8(0x40, 0x40, 0x40, 0xFF)); sf2d_texture *tex2 = sf2d_create_texture(200,120,TEXFMT_RGBA8,SF2D_PLACE_RAM); sf2d_set_pixel (tex2, 1, 1, 0xFFFF0000); // Blue sf2d_set_pixel (tex2, 0, 1, 0xFF7F0000); sf2d_set_pixel (tex2, 2, 2, 0xFF00FF00); // Green sf2d_set_pixel (tex2, 0, 2, 0xFF007F00); sf2d_set_pixel (tex2, 3, 3, 0xFF0000FF); // Red sf2d_set_pixel (tex2, 0, 3, 0xFF00007F); sf2d_set_pixel (tex2, 4, 4, 0xFFFFFFFF); // White sf2d_set_pixel (tex2, 0, 4, 0xFF7F7F7F); // Using RGBA8() does not change anything. consoleInit(GFX_BOTTOM, NULL); // Console on the bottom screen printf("Press 'Start' to exit."); while (aptMainLoop()) { hidScanInput(); if (hidKeysHeld() & KEY_START) { break; } sf2d_start_frame(GFX_TOP, GFX_LEFT); sf2d_draw_texture_scale(tex2, 0, 0, 2.0, 2.0); sf2d_end_frame(); sf2d_swapbuffers(); } sf2d_free_texture(tex2); sf2d_fini(); return 0; }
The pixels seem to be coming from the top-right of my 3ds screen. (I apologize for the sub-potato quality):
I've used sf2d_get_pixel() on textures and it works perfectly fine. I don't know if I am doing something wrong or if it is a bug with this function.
There's several ways to accomplish this. The approach I've used in the past is to render just the alpha channel of the square with blending disabled, then render the alpha channel of the circle over it (presumably your circle would be a quad with a circle textured onto it), then render the square again with bending and all color channels enabled with the blending mode set to DST_ALPHA, ONE_MINUS_DST_ALPHA. This has the advantage of "cutting out" while retaining the effect of gradients due to alpha blending. Stencils are slightly easier to use IMO.Is there an easy way to achieve a 'minus' effect on a square/texture? Like render a square with a circle section cut out of it. I'm aware of the scissor test, but that seems limited in functionality. I'm asking this because the project I'm porting uses it for underground lighting. I can just use the functions used by the game, but they are relatively intensive on the cpu. I don't want to worry about frame drops, so I was wondering if there is a better way of doing it.
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glColor4f(1, 1, 1, 1);
bind_texture();
//draw main object's alpha
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(X, Y);
glTexCoord2f(1, 0);
glVertex2f(X + Width, Y);
glTexCoord2f(1, 1);
glVertex2f(X + Width, Y + Height);
glTexCoord2f(0, 1);
glVertex2f(X, Y + Height);
glEnd();
glEnable(GL_BLEND);
glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//draw cut out (i used some baked text here)
ui_label::Draw();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);
bind_texture();
glColor4f(1, 1, 1, 1);
//draw main object again...
Python is not in your pathTried installing, gettingan error related with Python? Just tried using the method from https://stonedcoders.wordpress.com/2015/08/29/setting-up-sf2dlib/
Have you installed python in the folder C:\python34? It seems like you either didn't install python 3, or installed it elsewhere.Tried installing, gettingan error related with Python? Just tried using the method from https://stonedcoders.wordpress.com/2015/08/29/setting-up-sf2dlib/
@C:\Python34\python.exe C:\Users\Admin\Desktop\sf2dlib-master\libsf2d\aemstro_as.py $< ../$(notdir $<).shbin
@C:\Python34\python.exe C:\Users\Admin\Desktop\sf2dlib-master\libsf2d\aemstro_as.py $< ../$(notdir $<).shbin)
thanks manSeems more like there is a superfluous ) in that line, it should be:
Code:@C:\Python34\python.exe C:\Users\Admin\Desktop\sf2dlib-master\libsf2d\aemstro_as.py $< ../$(notdir $<).shbin
Not
Code:@C:\Python34\python.exe C:\Users\Admin\Desktop\sf2dlib-master\libsf2d\aemstro_as.py $< ../$(notdir $<).shbin)